2020-08-25 20:28:25 -07: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 14:28:55 +00:00
|
|
|
//~^ ERROR mismatched types
|
2020-08-25 20:28:25 -07:00
|
|
|
if Some(foo) = bar {} //~ ERROR mismatched types
|
|
|
|
if 3 = foo {} //~ ERROR mismatched types
|
|
|
|
if Some(3) = foo {} //~ ERROR mismatched types
|
2021-11-03 02:50:57 -04: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 20:28:25 -07:00
|
|
|
}
|