]>
Commit | Line | Data |
---|---|---|
1 | //! Attributes producing expressions in invalid locations | |
2 | ||
3 | // aux-build:attr-stmt-expr.rs | |
4 | ||
5 | #![feature(proc_macro_hygiene)] | |
6 | #![feature(stmt_expr_attributes)] | |
7 | ||
8 | extern crate attr_stmt_expr; | |
9 | use attr_stmt_expr::{duplicate, no_output}; | |
10 | ||
11 | fn main() { | |
12 | let _ = #[no_output] "Hello, world!"; | |
13 | //~^ ERROR expected expression, found end of macro arguments | |
14 | ||
15 | let _ = #[duplicate] "Hello, world!"; | |
16 | //~^ ERROR macro expansion ignores token `,` and any following | |
17 | ||
18 | let _ = { | |
19 | #[no_output] | |
20 | "Hello, world!" | |
21 | }; | |
22 | ||
23 | let _ = { | |
24 | #[duplicate] | |
25 | //~^ ERROR macro expansion ignores token `,` and any following | |
26 | "Hello, world!" | |
27 | }; | |
28 | } |