summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/bare-struct-body.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/parser/bare-struct-body.rs')
-rw-r--r--src/test/ui/parser/bare-struct-body.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/parser/bare-struct-body.rs b/src/test/ui/parser/bare-struct-body.rs
new file mode 100644
index 000000000..a557e861d
--- /dev/null
+++ b/src/test/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: (),
+ };
+}