]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/nonterminal-token-hygiene.stdout
Rollup merge of #106788 - estebank:elaborate_pred_E0599, r=compiler-errors
[rust.git] / tests / ui / proc-macro / nonterminal-token-hygiene.stdout
1 PRINT-BANG INPUT (DISPLAY): struct S;
2 PRINT-BANG RE-COLLECTED (DISPLAY): struct S ;
3 PRINT-BANG INPUT (DEBUG): TokenStream [
4     Group {
5         delimiter: None,
6         stream: TokenStream [
7             Ident {
8                 ident: "struct",
9                 span: $DIR/nonterminal-token-hygiene.rs:31:5: 31:11 (#5),
10             },
11             Ident {
12                 ident: "S",
13                 span: $DIR/nonterminal-token-hygiene.rs:31:12: 31:13 (#5),
14             },
15             Punct {
16                 ch: ';',
17                 spacing: Alone,
18                 span: $DIR/nonterminal-token-hygiene.rs:31:13: 31:14 (#5),
19             },
20         ],
21         span: $DIR/nonterminal-token-hygiene.rs:21:27: 21:32 (#6),
22     },
23 ]
24 #![feature /* 0#0 */(prelude_import)]
25 #![no_std /* 0#0 */]
26 // Make sure that marks from declarative macros are applied to tokens in nonterminal.
27
28 // check-pass
29 // compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene
30 // compile-flags: -Z trim-diagnostic-paths=no
31 // normalize-stdout-test "\d+#" -> "0#"
32 // normalize-stdout-test "expn\d{3,}" -> "expnNNN"
33 // aux-build:test-macros.rs
34
35 #![feature /* 0#0 */(decl_macro)]
36
37 #![no_std /* 0#0 */]
38 #[prelude_import /* 0#1 */]
39 use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*;
40 #[macro_use /* 0#1 */]
41 extern crate core /* 0#2 */;
42 #[macro_use /* 0#1 */]
43 extern crate compiler_builtins /* 0#2 */;
44 // Don't load unnecessary hygiene information from std
45 extern crate std /* 0#0 */;
46
47 #[macro_use /* 0#0 */]
48 extern crate test_macros /* 0#0 */;
49
50 macro_rules! outer
51     /*
52     0#0
53     */ {
54     ($item : item) =>
55     {
56         macro inner() { print_bang! { $item } } inner! () ;
57
58     } ;
59 }
60
61 struct S /* 0#0 */;
62 macro inner /* 0#4 */ { () => { print_bang! { struct S; } } }
63
64 struct S /* 0#5 */;
65 // OK, not a duplicate definition of `S`
66
67 fn main /* 0#0 */() {}
68
69 /*
70 Expansions:
71 crate0::{{expn0}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Root
72 crate0::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports)
73 crate0::{{expn2}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "outer")
74 crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #4, def_site_ctxt: #4, kind: Macro(Bang, "inner")
75 crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #6, def_site_ctxt: #0, kind: Macro(Bang, "print_bang")
76 crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive")
77 crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Attr, "derive")
78 crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "include")
79 crate2::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports)
80
81 SyntaxContexts:
82 #0: parent: #0, outer_mark: (crate0::{{expn0}}, Opaque)
83 #1: parent: #0, outer_mark: (crate0::{{expn1}}, Opaque)
84 #2: parent: #0, outer_mark: (crate0::{{expn1}}, Transparent)
85 #3: parent: #0, outer_mark: (crate2::{{expn1}}, Opaque)
86 #4: parent: #0, outer_mark: (crate0::{{expn2}}, SemiTransparent)
87 #5: parent: #0, outer_mark: (crate0::{{expn3}}, Opaque)
88 #6: parent: #4, outer_mark: (crate0::{{expn3}}, Opaque)
89 #7: parent: #0, outer_mark: (crate0::{{expn4}}, Opaque)
90 #8: parent: #6, outer_mark: (crate0::{{expn4}}, Transparent)
91 #9: parent: #5, outer_mark: (crate0::{{expn4}}, SemiTransparent)
92 */