diff options
Diffstat (limited to 'tests/ui/parser/bare-struct-body.rs')
-rw-r--r-- | tests/ui/parser/bare-struct-body.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/parser/bare-struct-body.rs b/tests/ui/parser/bare-struct-body.rs new file mode 100644 index 000000000..a557e861d --- /dev/null +++ b/tests/ui/parser/bare-struct-body.rs @@ -0,0 +1,15 @@ +struct Foo { + val: (), +} + +fn foo() -> Foo { //~ ERROR struct literal body without path + val: (), +} + +fn main() { + let x = foo(); + x.val == 42; //~ ERROR mismatched types + let x = { //~ ERROR struct literal body without path + val: (), + }; +} |