]> git.lizzy.rs Git - rust.git/blob - src/test/ui/proc-macro/meta-macro-hygiene.stdout
Rollup merge of #80771 - thomcc:nonnull-refmut, r=dtolnay
[rust.git] / src / test / ui / proc-macro / meta-macro-hygiene.stdout
1 Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5)
2 Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
3 Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }]
4 #![feature /* 0#0 */(prelude_import)]
5 // ignore-tidy-linelength
6 // aux-build:make-macro.rs
7 // aux-build:meta-macro.rs
8 // edition:2018
9 // compile-flags: -Z span-debug -Z macro-backtrace -Z unpretty=expanded,hygiene -Z trim-diagnostic-paths=no
10 // check-pass
11 // normalize-stdout-test "\d+#" -> "0#"
12 //
13 // We don't care about symbol ids, so we set them all to 0
14 // in the stdout
15
16 #![no_std /* 0#0 */]
17 #[prelude_import /* 0#1 */]
18 use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*;
19 #[macro_use /* 0#1 */]
20 extern crate core /* 0#1 */;
21 #[macro_use /* 0#1 */]
22 extern crate compiler_builtins /* 0#1 */;
23 // Don't load unnecessary hygiene information from std
24 extern crate std /* 0#0 */;
25
26 extern crate meta_macro /* 0#0 */;
27
28 macro_rules! produce_it
29     /*
30     0#0
31     */ {
32     () =>
33     {
34         meta_macro :: print_def_site ! ($ crate :: dummy ! ()) ;
35         // `print_def_site!` will respan the `$crate` identifier
36         // with `Span::def_site()`. This should cause it to resolve
37         // relative to `meta_macro`, *not* `make_macro` (despite
38         // the fact that that `print_def_site` is produced by
39         // a `macro_rules!` macro in `make_macro`).
40     }
41 }
42
43 fn main /* 0#0 */() { ; }
44
45 /*
46 Expansions:
47 0: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Root
48 1: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports)
49 2: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: Macro(Bang, "produce_it")
50 3: parent: ExpnId(0), call_site_ctxt: #0, def_site_ctxt: #0, kind: AstPass(StdImports)
51 4: parent: ExpnId(2), call_site_ctxt: #4, def_site_ctxt: #0, kind: Macro(Bang, "meta_macro::print_def_site")
52 5: parent: ExpnId(4), call_site_ctxt: #5, def_site_ctxt: #0, kind: Macro(Bang, "$crate::dummy")
53
54 SyntaxContexts:
55 #0: parent: #0, outer_mark: (ExpnId(0), Opaque)
56 #1: parent: #0, outer_mark: (ExpnId(1), Opaque)
57 #2: parent: #0, outer_mark: (ExpnId(1), Transparent)
58 #3: parent: #0, outer_mark: (ExpnId(3), Opaque)
59 #4: parent: #0, outer_mark: (ExpnId(2), SemiTransparent)
60 #5: parent: #0, outer_mark: (ExpnId(4), Opaque)
61 #6: parent: #4, outer_mark: (ExpnId(4), Transparent)
62 #7: parent: #0, outer_mark: (ExpnId(4), SemiTransparent)
63 #8: parent: #0, outer_mark: (ExpnId(5), Opaque)
64 #9: parent: #5, outer_mark: (ExpnId(5), Transparent)
65 #10: parent: #5, outer_mark: (ExpnId(5), SemiTransparent)
66 */