about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/range/misleading-field-access-hint.rs8
-rw-r--r--tests/ui/range/misleading-field-access-hint.stderr9
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/range/misleading-field-access-hint.rs b/tests/ui/range/misleading-field-access-hint.rs
new file mode 100644
index 00000000000..252f1a4833c
--- /dev/null
+++ b/tests/ui/range/misleading-field-access-hint.rs
@@ -0,0 +1,8 @@
+// Check if rustc still displays the misleading hint to write `.` instead of `..`
+fn main() {
+    let width = 10;
+    // ...
+    for _ in 0..w {
+        //~^ ERROR cannot find value `w`
+    }
+}
diff --git a/tests/ui/range/misleading-field-access-hint.stderr b/tests/ui/range/misleading-field-access-hint.stderr
new file mode 100644
index 00000000000..9b112a5fdd8
--- /dev/null
+++ b/tests/ui/range/misleading-field-access-hint.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `w` in this scope
+  --> $DIR/misleading-field-access-hint.rs:5:17
+   |
+LL |     for _ in 0..w {
+   |                 ^ not found in this scope
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0425`.