2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2018-09-22 17:07:56 -07:00
|
|
|
#![feature(box_patterns)]
|
2018-03-03 06:05:54 +08:00
|
|
|
|
|
|
|
const VALUE: usize = 21;
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
match &18 {
|
|
|
|
&(18..=18) => {}
|
|
|
|
_ => { unreachable!(); }
|
|
|
|
}
|
|
|
|
match &21 {
|
|
|
|
&(VALUE..=VALUE) => {}
|
|
|
|
_ => { unreachable!(); }
|
|
|
|
}
|
|
|
|
match Box::new(18) {
|
|
|
|
box (18..=18) => {}
|
|
|
|
_ => { unreachable!(); }
|
|
|
|
}
|
|
|
|
match Box::new(21) {
|
|
|
|
box (VALUE..=VALUE) => {}
|
|
|
|
_ => { unreachable!(); }
|
|
|
|
}
|
|
|
|
}
|