mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
24 lines
439 B
Rust
24 lines
439 B
Rust
// run-pass
|
|
#![feature(box_patterns)]
|
|
|
|
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!(); }
|
|
}
|
|
}
|