2022-12-21 09:29:35 -06:00
|
|
|
#![feature(if_let_guard)]
|
|
|
|
|
2017-10-13 08:36:15 -05:00
|
|
|
fn foo(_:String) {}
|
|
|
|
|
|
|
|
fn main()
|
|
|
|
{
|
|
|
|
let my_str = "hello".to_owned();
|
|
|
|
match Some(42) {
|
|
|
|
Some(_) if { drop(my_str); false } => {}
|
|
|
|
Some(_) => {}
|
2017-11-19 16:37:59 -06:00
|
|
|
None => { foo(my_str); } //~ ERROR [E0382]
|
2017-10-13 08:36:15 -05:00
|
|
|
}
|
2022-12-21 09:29:35 -06:00
|
|
|
|
|
|
|
let my_str = "hello".to_owned();
|
|
|
|
match Some(42) {
|
|
|
|
Some(_) if let Some(()) = { drop(my_str); None } => {}
|
|
|
|
Some(_) => {}
|
|
|
|
None => { foo(my_str); } //~ ERROR [E0382]
|
|
|
|
}
|
2017-10-13 08:36:15 -05:00
|
|
|
}
|