summaryrefslogtreecommitdiffstats
path: root/tests/ui/macros/attr-empty-expr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/macros/attr-empty-expr.rs')
-rw-r--r--tests/ui/macros/attr-empty-expr.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/macros/attr-empty-expr.rs b/tests/ui/macros/attr-empty-expr.rs
new file mode 100644
index 000000000..d4d1a3ee7
--- /dev/null
+++ b/tests/ui/macros/attr-empty-expr.rs
@@ -0,0 +1,11 @@
+// AST-based macro attributes expanding to an empty expression produce an error and not ICE.
+
+#![feature(custom_test_frameworks)]
+#![feature(stmt_expr_attributes)]
+#![feature(test)]
+
+fn main() {
+ let _ = #[test] 0; //~ ERROR removing an expression is not supported in this position
+ let _ = #[bench] 1; //~ ERROR removing an expression is not supported in this position
+ let _ = #[test_case] 2; //~ ERROR removing an expression is not supported in this position
+}