File tree Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Expand file tree Collapse file tree 3 files changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,9 @@ macro_rules! external {
1414 struct D ( $crate:: S ) ;
1515 } ;
1616}
17+
18+ #[ macro_export]
19+ macro_rules! issue_62325 { ( ) => {
20+ #[ print_attr]
21+ struct B ( identity!( $crate:: S ) ) ;
22+ } }
Original file line number Diff line number Diff line change 11// check-pass
22// edition:2018
33// aux-build:test-macros.rs
4+ // aux-build:dollar-crate-external.rs
45
56// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
67// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
1011
1112#[ macro_use]
1213extern crate test_macros;
14+ extern crate dollar_crate_external;
1315
1416type S = u8 ;
1517
@@ -20,4 +22,6 @@ macro_rules! m { () => {
2022
2123m ! ( ) ;
2224
25+ dollar_crate_external:: issue_62325!( ) ;
26+
2327fn main ( ) { }
Original file line number Diff line number Diff line change @@ -54,3 +54,59 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
5454 span: #2 bytes(LO..HI),
5555 },
5656]
57+ PRINT-ATTR INPUT (DISPLAY): struct B(identity!(::dollar_crate_external :: S));
58+ PRINT-ATTR RE-COLLECTED (DISPLAY): struct B ( identity ! ( ::dollar_crate_external :: S ) ) ;
59+ PRINT-ATTR INPUT (DEBUG): TokenStream [
60+ Ident {
61+ ident: "struct",
62+ span: #7 bytes(LO..HI),
63+ },
64+ Ident {
65+ ident: "B",
66+ span: #7 bytes(LO..HI),
67+ },
68+ Group {
69+ delimiter: Parenthesis,
70+ stream: TokenStream [
71+ Ident {
72+ ident: "identity",
73+ span: #7 bytes(LO..HI),
74+ },
75+ Punct {
76+ ch: '!',
77+ spacing: Alone,
78+ span: #7 bytes(LO..HI),
79+ },
80+ Group {
81+ delimiter: Parenthesis,
82+ stream: TokenStream [
83+ Ident {
84+ ident: "$crate",
85+ span: #7 bytes(LO..HI),
86+ },
87+ Punct {
88+ ch: ':',
89+ spacing: Joint,
90+ span: #7 bytes(LO..HI),
91+ },
92+ Punct {
93+ ch: ':',
94+ spacing: Alone,
95+ span: #7 bytes(LO..HI),
96+ },
97+ Ident {
98+ ident: "S",
99+ span: #7 bytes(LO..HI),
100+ },
101+ ],
102+ span: #7 bytes(LO..HI),
103+ },
104+ ],
105+ span: #7 bytes(LO..HI),
106+ },
107+ Punct {
108+ ch: ';',
109+ spacing: Alone,
110+ span: #7 bytes(LO..HI),
111+ },
112+ ]
You can’t perform that action at this time.
0 commit comments