]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-drop-from-guard.rs
Rollup merge of #88090 - nbdd0121:inference, r=nikomatsakis
[rust.git] / src / test / ui / borrowck / borrowck-drop-from-guard.rs
1 //compile-flags: -Z borrowck=mir
2
3 fn foo(_:String) {}
4
5 fn main()
6 {
7     let my_str = "hello".to_owned();
8     match Some(42) {
9         Some(_) if { drop(my_str); false } => {}
10         Some(_) => {}
11         None => { foo(my_str); } //~ ERROR [E0382]
12     }
13 }