mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
21 lines
449 B
Rust
21 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]
|
|
}
|
|
}
|