summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/if-let-typo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/suggestions/if-let-typo.rs')
-rw-r--r--src/test/ui/suggestions/if-let-typo.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/if-let-typo.rs b/src/test/ui/suggestions/if-let-typo.rs
new file mode 100644
index 000000000..375bd3f03
--- /dev/null
+++ b/src/test/ui/suggestions/if-let-typo.rs
@@ -0,0 +1,11 @@
+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
+}