]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/nonterminal-token-hygiene.rs
Rollup merge of #77151 - rust-lang:LeSeulArtichaut-patch-1, r=pnkfelix
[rust.git] / src / test / ui / proc-macro / nonterminal-token-hygiene.rs
1 // Make sure that marks from declarative macros are applied to tokens in nonterminal.
2
3 // check-pass
4 // compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene
5 // compile-flags: -Z trim-diagnostic-paths=no
6 // normalize-stdout-test "\d+#" -> "0#"
7 // aux-build:test-macros.rs
8
9 #![feature(decl_macro)]
10
11 #![no_std] // Don't load unnecessary hygiene information from std
12 extern crate std;
13
14 #[macro_use]
15 extern crate test_macros;
16
17 macro_rules! outer {
18     ($item:item) => {
19         macro inner() {
20             print_bang! { $item }
21         }
22
23         inner!();
24     };
25 }
26
27 struct S;
28
29 outer! {
30     struct S; // OK, not a duplicate definition of `S`
31 }
32
33 fn main() {}