diff options
Diffstat (limited to 'src/test/ui/structs/struct-fields-typo.rs')
-rw-r--r-- | src/test/ui/structs/struct-fields-typo.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/structs/struct-fields-typo.rs b/src/test/ui/structs/struct-fields-typo.rs new file mode 100644 index 000000000..0e9b2ae51 --- /dev/null +++ b/src/test/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); +} |