mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
20 lines
449 B
Rust
20 lines
449 B
Rust
#![feature(if_let_guard)]
|
|
|
|
fn foo(_:String) {}
|
|
|
|
fn main()
|
|
{
|
|
let my_str = "hello".to_owned();
|
|
match Some(42) {
|
|
Some(_) if { drop(my_str); false } => {}
|
|
Some(_) => {}
|
|
None => { foo(my_str); } //~ ERROR [E0382]
|
|
}
|
|
|
|
let my_str = "hello".to_owned();
|
|
match Some(42) {
|
|
Some(_) if let Some(()) = { drop(my_str); None } => {}
|
|
Some(_) => {}
|
|
None => { foo(my_str); } //~ ERROR [E0382]
|
|
}
|
|
}
|