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
This commit is contained in:
commit
1d3e84c5d6
7 changed files with 183 additions and 81 deletions
6
src/test/compile-fail/match-ill-type1.rs
Normal file
6
src/test/compile-fail/match-ill-type1.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
fn main() {
|
||||
match 1 {
|
||||
1..2u => 1, //~ ERROR mismatched types in range
|
||||
_ => 2,
|
||||
};
|
||||
}
|
||||
7
src/test/compile-fail/match-ill-type2.rs
Normal file
7
src/test/compile-fail/match-ill-type2.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fn main() {
|
||||
match 1 {
|
||||
1 => 1, //~ ERROR mismatched types between arms
|
||||
2u => 1,
|
||||
_ => 2,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue