]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/if-let-typo.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / if-let-typo.rs
1 fn main() {
2     let foo = Some(0);
3     let bar = None;
4     if Some(x) = foo {} //~ ERROR cannot find value `x` in this scope
5     //~^ ERROR mismatched types
6     if Some(foo) = bar {} //~ ERROR mismatched types
7     if 3 = foo {} //~ ERROR mismatched types
8     if Some(3) = foo {} //~ ERROR mismatched types
9     //~^ ERROR invalid left-hand side of assignment
10     if x = 5 {}  //~ ERROR cannot find value `x` in this scope
11 }