rust/tests/ui/pattern/deref-patterns/fake_borrows.rs
2024-04-20 16:04:05 +02:00

15 lines
309 B
Rust

#![feature(deref_patterns)]
#![allow(incomplete_features)]
#[rustfmt::skip]
fn main() {
let mut b = Box::new(false);
match b {
deref!(true) => {}
_ if { *b = true; false } => {}
//~^ ERROR cannot assign `*b` in match guard
deref!(false) => {}
_ => {},
}
}