mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
12 lines
423 B
Rust
12 lines
423 B
Rust
fn main() {
|
|
let foo = Some(0);
|
|
let bar = None;
|
|
if Some(x) = foo {} //~ ERROR cannot find value `x` in this scope
|
|
//~^ ERROR mismatched types
|
|
if Some(foo) = bar {} //~ ERROR mismatched types
|
|
if 3 = foo {} //~ ERROR mismatched types
|
|
if Some(3) = foo {} //~ ERROR mismatched types
|
|
//~^ ERROR invalid left-hand side of assignment
|
|
if x = 5 {} //~ ERROR cannot find value `x` in this scope
|
|
}
|