]> git.proxmox.com Git - rustc.git/blame - src/test/ui/proc-macro/nonterminal-token-hygiene.stdout
New upstream version 1.57.0+dfsg1
[rustc.git] / src / test / ui / proc-macro / nonterminal-token-hygiene.stdout
CommitLineData
29967ef6
XL
1PRINT-BANG INPUT (DISPLAY): struct S;
2PRINT-BANG RE-COLLECTED (DISPLAY): struct S ;
3PRINT-BANG INPUT (DEBUG): TokenStream [
4 Group {
5 delimiter: None,
6 stream: TokenStream [
7 Ident {
8 ident: "struct",
c295e0f8 9 span: $DIR/nonterminal-token-hygiene.rs:31:5: 31:11 (#5),
29967ef6
XL
10 },
11 Ident {
12 ident: "S",
c295e0f8 13 span: $DIR/nonterminal-token-hygiene.rs:31:12: 31:13 (#5),
29967ef6
XL
14 },
15 Punct {
16 ch: ';',
17 spacing: Alone,
c295e0f8 18 span: $DIR/nonterminal-token-hygiene.rs:31:13: 31:14 (#5),
29967ef6
XL
19 },
20 ],
c295e0f8 21 span: $DIR/nonterminal-token-hygiene.rs:21:27: 21:32 (#6),
29967ef6
XL
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#"
c295e0f8 32// normalize-stdout-test "expn\d{3,}" -> "expnNNN"
29967ef6
XL
33// aux-build:test-macros.rs
34
35#![feature /* 0#0 */(decl_macro)]
36
37#![no_std /* 0#0 */]
38#[prelude_import /* 0#1 */]
6a06907d 39use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*;
29967ef6
XL
40#[macro_use /* 0#1 */]
41extern crate core /* 0#2 */;
42#[macro_use /* 0#1 */]
43extern crate compiler_builtins /* 0#2 */;
44// Don't load unnecessary hygiene information from std
45extern crate std /* 0#0 */;
46
47#[macro_use /* 0#0 */]
48extern crate test_macros /* 0#0 */;
49
50macro_rules! outer
51 /*
52 0#0
53 */ {
136023e0 54 ($item : item) =>
29967ef6 55 {
136023e0 56 macro inner() { print_bang! { $item } } inner! () ;
29967ef6
XL
57
58 } ;
59}
60
61struct S /* 0#0 */;
17df50a5 62macro inner /* 0#4 */ { () => { print_bang! { struct S; } } }
29967ef6
XL
63
64struct S /* 0#5 */;
65// OK, not a duplicate definition of `S`
66
67fn main /* 0#0 */() { }
68
69/*
70Expansions:
136023e0
XL
71crate0::{{expn0}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Root
72crate0::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports)
73crate0::{{expn2}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "outer")
74crate0::{{expn3}}: parent: crate0::{{expn2}}, call_site_ctxt: #4, def_site_ctxt: #4, kind: Macro(Bang, "inner")
75crate0::{{expn4}}: parent: crate0::{{expn3}}, call_site_ctxt: #6, def_site_ctxt: #0, kind: Macro(Bang, "print_bang")
c295e0f8 76crate1::{{expnNNN}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "include")
136023e0 77crate2::{{expn1}}: parent: crate0::{{expn0}}, call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports)
29967ef6
XL
78
79SyntaxContexts:
136023e0
XL
80#0: parent: #0, outer_mark: (crate0::{{expn0}}, Opaque)
81#1: parent: #0, outer_mark: (crate0::{{expn1}}, Opaque)
82#2: parent: #0, outer_mark: (crate0::{{expn1}}, Transparent)
83#3: parent: #0, outer_mark: (crate2::{{expn1}}, Opaque)
84#4: parent: #0, outer_mark: (crate0::{{expn2}}, SemiTransparent)
85#5: parent: #0, outer_mark: (crate0::{{expn3}}, Opaque)
86#6: parent: #4, outer_mark: (crate0::{{expn3}}, Opaque)
87#7: parent: #0, outer_mark: (crate0::{{expn4}}, Opaque)
88#8: parent: #6, outer_mark: (crate0::{{expn4}}, Transparent)
89#9: parent: #5, outer_mark: (crate0::{{expn4}}, SemiTransparent)
29967ef6 90*/