]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/attr-invalid-exprs.rs
New upstream version 1.45.0+dfsg1
[rustc.git] / src / test / ui / proc-macro / attr-invalid-exprs.rs
CommitLineData
0531ce1d
XL
1//! Attributes producing expressions in invalid locations
2
f9f354fc
XL
3// aux-build:attr-stmt-expr.rs
4
5#![feature(proc_macro_hygiene)]
6#![feature(stmt_expr_attributes)]
0531ce1d
XL
7
8extern crate attr_stmt_expr;
9use attr_stmt_expr::{duplicate, no_output};
10
11fn main() {
12 let _ = #[no_output] "Hello, world!";
dc9dc135 13 //~^ ERROR expected expression, found end of macro arguments
0531ce1d
XL
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}