fix issue #6209
auto merge of #6669 : yjh0502/rust/fix_6209, r=graydon

Fix issue #6209, and some related issues about constant expression
 - unmatched type between arms
 - unmatched type in range