blob: 688b6e826582610956fc49e3e50f6c56734652a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
fn main() {
let foo = Some(0);
let bar = None;
if Some(x) = foo {} //~ ERROR cannot find value `x` in this scope
//~^ ERROR mismatched types
//~^^ ERROR destructuring assignments are unstable
if Some(foo) = bar {} //~ ERROR mismatched types
//~^ ERROR destructuring assignments are unstable
if 3 = foo {} //~ ERROR mismatched types
if Some(3) = foo {} //~ ERROR mismatched types
//~^ ERROR destructuring assignments are unstable
//~^^ ERROR invalid left-hand side of assignment
}
|