summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/while-let-typo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/suggestions/while-let-typo.rs')
-rw-r--r--src/test/ui/suggestions/while-let-typo.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/while-let-typo.rs b/src/test/ui/suggestions/while-let-typo.rs
new file mode 100644
index 000000000..dbbcdee3c
--- /dev/null
+++ b/src/test/ui/suggestions/while-let-typo.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let foo = Some(0);
+ let bar = None;
+ while Some(x) = foo {} //~ ERROR cannot find value `x` in this scope
+ while Some(foo) = bar {}
+ while 3 = foo {} //~ ERROR mismatched types
+ while Some(3) = foo {} //~ ERROR invalid left-hand side of assignment
+ while x = 5 {} //~ ERROR cannot find value `x` in this scope
+}