]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/expr-stmt-nonterminal-tokens.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / proc-macro / expr-stmt-nonterminal-tokens.rs
CommitLineData
17df50a5
XL
1// check-pass
2// aux-build:test-macros.rs
3
4#![feature(decl_macro)]
5#![feature(stmt_expr_attributes)]
6
7#![no_std] // Don't load unnecessary hygiene information from std
8extern crate std;
9
10#[macro_use]
11extern crate test_macros;
12
13macro mac {
14 (expr $expr:expr) => {
15 #[derive(Print)]
16 enum E {
17 V = { let _ = $expr; 0 },
18 }
19 },
20 (stmt $stmt:stmt) => {
21 #[derive(Print)]
22 enum E {
23 V = { let _ = { $stmt }; 0 },
24 }
25 },
26}
27
28const PATH: u8 = 2;
29
30fn main() {
31 mac!(expr #[allow(warnings)] 0);
32 mac!(stmt 0);
33 mac!(stmt {});
34 mac!(stmt PATH);
35 mac!(stmt 0 + 1);
36 mac!(stmt PATH + 1);
37}