rust/tests/ui/binding/inferred-suffix-in-pattern-range.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
607 B
Rust
Raw Normal View History

// run-pass
pub fn main() {
2015-01-25 21:05:03 +00:00
let x = 2;
2012-08-06 19:34:08 +00:00
let x_message = match x {
0 ..= 1 => { "not many".to_string() }
2014-05-25 10:10:11 +00:00
_ => { "lots".to_string() }
};
2014-05-25 10:10:11 +00:00
assert_eq!(x_message, "lots".to_string());
2015-01-25 21:05:03 +00:00
let y = 2;
2012-08-06 19:34:08 +00:00
let y_message = match y {
0 ..= 1 => { "not many".to_string() }
2014-05-25 10:10:11 +00:00
_ => { "lots".to_string() }
};
2014-05-25 10:10:11 +00:00
assert_eq!(y_message, "lots".to_string());
let z = 1u64;
2012-08-06 19:34:08 +00:00
let z_message = match z {
0 ..= 1 => { "not many".to_string() }
2014-05-25 10:10:11 +00:00
_ => { "lots".to_string() }
};
2014-05-25 10:10:11 +00:00
assert_eq!(z_message, "not many".to_string());
}