]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-drop-from-guard.rs
Auto merge of #101768 - sunfishcode:sunfishcode/wasi-stdio-lock-asfd, r=joshtriplett
[rust.git] / src / test / ui / borrowck / borrowck-drop-from-guard.rs
1 fn foo(_:String) {}
2
3 fn main()
4 {
5     let my_str = "hello".to_owned();
6     match Some(42) {
7         Some(_) if { drop(my_str); false } => {}
8         Some(_) => {}
9         None => { foo(my_str); } //~ ERROR [E0382]
10     }
11 }