about summary refs log tree commit diff
path: root/tests/ui/structs/struct-fields-typo.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/structs/struct-fields-typo.rs')
-rw-r--r--tests/ui/structs/struct-fields-typo.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/structs/struct-fields-typo.rs b/tests/ui/structs/struct-fields-typo.rs
new file mode 100644
index 00000000000..0e9b2ae5145
--- /dev/null
+++ b/tests/ui/structs/struct-fields-typo.rs
@@ -0,0 +1,15 @@
+struct BuildData {
+    foo: isize,
+    bar: f32
+}
+
+fn main() {
+    let foo = BuildData {
+        foo: 0,
+        bar: 0.5,
+    };
+    let x = foo.baa; //~ ERROR no field `baa` on type `BuildData`
+                     //~| HELP a field with a similar name exists
+                     //~| SUGGESTION bar
+    println!("{}", x);
+}