rust/src/test/compile-fail/alt-range-fail-dominate.rs
Marijn Haverbeke 5d6a74f020 Only warn about unreachable range patterns when appropriate
Also simplifies the literal-munging, and moves it into ast_util

Closes #1170
2011-11-22 11:49:29 +01:00

32 lines
455 B
Rust

//error-pattern: unreachable
//error-pattern: unreachable
//error-pattern: unreachable
//error-pattern: unreachable
//error-pattern: unreachable
fn main() {
alt 5u {
1u to 10u { }
5u to 6u { }
};
alt 5u {
3u to 6u { }
4u to 6u { }
};
alt 5u {
4u to 6u { }
4u to 6u { }
};
alt 'c' {
'A' to 'z' {}
'a' to 'z' {}
};
alt 1.0 {
0.01 to 6.5 {}
0.02 {}
};
}