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