2020-08-25 22:28:25 -05:00
|
|
|
fn main() {
|
|
|
|
let foo = Some(0);
|
|
|
|
let bar = None;
|
|
|
|
if Some(x) = foo {} //~ ERROR cannot find value `x` in this scope
|
2020-11-07 08:28:55 -06:00
|
|
|
//~^ ERROR mismatched types
|
2020-08-25 22:28:25 -05:00
|
|
|
if Some(foo) = bar {} //~ ERROR mismatched types
|
|
|
|
if 3 = foo {} //~ ERROR mismatched types
|
|
|
|
if Some(3) = foo {} //~ ERROR mismatched types
|
2021-11-03 01:50:57 -05:00
|
|
|
//~^ ERROR invalid left-hand side of assignment
|
2021-08-27 18:28:22 -05:00
|
|
|
if x = 5 {} //~ ERROR cannot find value `x` in this scope
|
2020-08-25 22:28:25 -05:00
|
|
|
}
|