summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/item-free-const-no-body-semantic-fail.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/item-free-const-no-body-semantic-fail.rs')
-rw-r--r--tests/ui/parser/item-free-const-no-body-semantic-fail.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/parser/item-free-const-no-body-semantic-fail.rs b/tests/ui/parser/item-free-const-no-body-semantic-fail.rs
new file mode 100644
index 000000000..613b3c985
--- /dev/null
+++ b/tests/ui/parser/item-free-const-no-body-semantic-fail.rs
@@ -0,0 +1,7 @@
+// Semantically, a free `const` item cannot omit its body.
+
+fn main() {}
+
+const A: u8; //~ ERROR free constant item without body
+const B; //~ ERROR free constant item without body
+//~^ ERROR missing type for `const` item