Skip to content

Commit 41e4a3e

Browse files
committed
Don't insert spaces before most semicolons in print_tts.
This gives better output for code produced by proc macros.
1 parent ef71f10 commit 41e4a3e

26 files changed

+59
-73
lines changed

compiler/rustc_ast_pretty/src/pprust/state.rs

+7
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ fn space_between(tt1: &TokenTree, tt2: &TokenTree) -> bool {
160160
use TokenTree::Delimited as Del;
161161
use TokenTree::Token as Tok;
162162

163+
fn is_punct(tt: &TokenTree) -> bool {
164+
matches!(tt, TokenTree::Token(tok, _) if tok.is_punct())
165+
}
166+
163167
// Each match arm has one or more examples in comments. The default is to
164168
// insert space between adjacent tokens, except for the cases listed in
165169
// this match.
@@ -180,6 +184,9 @@ fn space_between(tt1: &TokenTree, tt2: &TokenTree) -> bool {
180184
// - Never type: `Fn() ->!`
181185
(_, Tok(Token { kind: Comma | Dot | Not, .. }, _)) => false,
182186

187+
// NON-PUNCT + `;`: `x = 3;`, `[T; 3]`
188+
(tt1, Tok(Token { kind: Semi, .. }, _)) if !is_punct(tt1) => false,
189+
183190
// IDENT + `(`: `f(3)`
184191
//
185192
// FIXME: Incorrect cases:

tests/pretty/delimited-token-groups.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mac! {
99
{
1010
fn clone() -> S
1111
{
12-
panic! () ;
12+
panic! ();
1313

1414
}
1515
}

tests/pretty/macro_rules.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// pp-exact
22

3-
macro_rules! brace { () => {} ; }
3+
macro_rules! brace { () => {}; }
44

5-
macro_rules! bracket[() => {} ;];
5+
macro_rules! bracket[() => {};];
66

7-
macro_rules! paren(() => {} ;);
7+
macro_rules! paren(() => {};);
88

99
macro_rules! matcher_brackets {
10-
(paren) => {} ; (bracket) => {} ; (brace) => {} ;
10+
(paren) => {}; (bracket) => {}; (brace) => {};
1111
}
1212

1313
macro_rules! all_fragments {
1414
($b : block, $e : expr, $i : ident, $it : item, $l : lifetime, $lit :
1515
literal, $m : meta, $p : pat, $pth : path, $s : stmt, $tt : tt, $ty : ty,
16-
$vis : vis) => {} ;
16+
$vis : vis) => {};
1717
}
1818

1919
fn main() {}

tests/pretty/stmt_expr_attributes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn _8() {
113113
}
114114

115115
fn _9() {
116-
macro_rules! stmt_mac { () => { let _ = () ; } }
116+
macro_rules! stmt_mac { () => { let _ = (); } }
117117

118118
#[rustc_dummy]
119119
stmt_mac!();

tests/ui/macros/trace_faulty_macros.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ LL | test!(let x = 1+1);
111111
= note: expanding `test! { let x = 1+1 }`
112112
= note: to `test! ((x, 1 + 1))`
113113
= note: expanding `test! { (x, 1 + 1) }`
114-
= note: to `let x = 1 + 1 ;`
114+
= note: to `let x = 1 + 1;`
115115

116116
error: aborting due to 5 previous errors
117117

tests/ui/proc-macro/allowed-attr-stmt-expr.stdout

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
PRINT-ATTR INPUT (DISPLAY): struct ItemWithSemi;
2-
PRINT-ATTR RE-COLLECTED (DISPLAY): struct ItemWithSemi ;
32
PRINT-ATTR INPUT (DEBUG): TokenStream [
43
Ident {
54
ident: "struct",
@@ -47,7 +46,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
4746
},
4847
]
4948
PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!";
50-
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_let] let string = "Hello, world!" ;
5149
PRINT-ATTR INPUT (DEBUG): TokenStream [
5250
Punct {
5351
ch: '#',
@@ -90,7 +88,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
9088
},
9189
]
9290
PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro!("{}", string);
93-
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ;
91+
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string);
9492
PRINT-ATTR INPUT (DEBUG): TokenStream [
9593
Punct {
9694
ch: '#',
@@ -144,7 +142,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
144142
},
145143
]
146144
PRINT-ATTR INPUT (DISPLAY): second_make_stmt!(#[allow(dead_code)] struct Bar {});
147-
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ;
145+
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {});
148146
PRINT-ATTR INPUT (DEBUG): TokenStream [
149147
Ident {
150148
ident: "second_make_stmt",
@@ -293,7 +291,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
293291
},
294292
]
295293
PRINT-ATTR INPUT (DISPLAY): #[rustc_dummy] struct NonBracedStruct;
296-
PRINT-ATTR RE-COLLECTED (DISPLAY): #[rustc_dummy] struct NonBracedStruct ;
297294
PRINT-ATTR INPUT (DEBUG): TokenStream [
298295
Punct {
299296
ch: '#',

tests/ui/proc-macro/attr-stmt-expr.stdout

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
3030
},
3131
]
3232
PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!";
33-
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_let] let string = "Hello, world!" ;
3433
PRINT-ATTR INPUT (DEBUG): TokenStream [
3534
Punct {
3635
ch: '#',
@@ -73,7 +72,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
7372
},
7473
]
7574
PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro!("{}", string);
76-
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ;
75+
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string);
7776
PRINT-ATTR INPUT (DEBUG): TokenStream [
7877
Punct {
7978
ch: '#',
@@ -127,7 +126,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
127126
},
128127
]
129128
PRINT-ATTR INPUT (DISPLAY): second_make_stmt!(#[allow(dead_code)] struct Bar {});
130-
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ;
129+
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {});
131130
PRINT-ATTR INPUT (DEBUG): TokenStream [
132131
Ident {
133132
ident: "second_make_stmt",
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fn main() { let y : u32 = "z" ; { let x: u32 = "y"; } }
1+
fn main() { let y : u32 = "z"; { let x: u32 = "y"; } }

tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ use proc_macro::TokenStream;
1010
#[proc_macro_attribute]
1111
pub fn expect_let(attr: TokenStream, item: TokenStream) -> TokenStream {
1212
assert!(attr.to_string().is_empty());
13-
assert_eq!(item.to_string(), "let string = \"Hello, world!\" ;");
13+
assert_eq!(item.to_string(), "let string = \"Hello, world!\";");
1414
item
1515
}
1616

1717
#[proc_macro_attribute]
1818
pub fn expect_my_macro_stmt(attr: TokenStream, item: TokenStream) -> TokenStream {
1919
assert!(attr.to_string().is_empty());
20-
assert_eq!(item.to_string(), "my_macro! (\"{}\", string) ;");
20+
assert_eq!(item.to_string(), "my_macro! (\"{}\", string);");
2121
item
2222
}
2323

tests/ui/proc-macro/cfg-eval-inner.stdout

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ PRINT-ATTR RE-COLLECTED (DISPLAY): impl Foo <
1111
{ field: [u8; { #![rustc_dummy(another_cursed_inner)] 1 }] } 0
1212
}] > { #![rustc_dummy(evaluated_attr)] fn bar() {} }
1313
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl Foo <
14-
[u8 ;
14+
[u8;
1515
{
1616
#! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
17-
{ field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
17+
{ field : [u8; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
1818
}] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
1919
PRINT-ATTR INPUT (DEBUG): TokenStream [
2020
Ident {

tests/ui/proc-macro/doc-comment-preserved.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PRINT-BANG INPUT (DISPLAY): /**
66
*******
77
*/
88
pub struct S;
9-
PRINT-BANG RE-COLLECTED (DISPLAY): #[doc = "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n"] pub struct S ;
9+
PRINT-BANG RE-COLLECTED (DISPLAY): #[doc = "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n"] pub struct S;
1010
PRINT-BANG INPUT (DEBUG): TokenStream [
1111
Punct {
1212
ch: '#',

tests/ui/proc-macro/dollar-crate-issue-57089.stdout

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S);
2-
PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ;
32
PRINT-BANG INPUT (DEBUG): TokenStream [
43
Ident {
54
ident: "struct",
@@ -40,7 +39,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
4039
},
4140
]
4241
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S);
43-
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ;
4442
PRINT-ATTR INPUT (DEBUG): TokenStream [
4543
Ident {
4644
ident: "struct",

tests/ui/proc-macro/dollar-crate-issue-62325.stdout

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
PRINT-ATTR INPUT (DISPLAY): struct A(identity! ($crate :: S));
2-
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A(identity! ($crate :: S)) ;
32
PRINT-ATTR INPUT (DEBUG): TokenStream [
43
Ident {
54
ident: "struct",
@@ -55,7 +54,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
5554
},
5655
]
5756
PRINT-ATTR INPUT (DISPLAY): struct B(identity! ($crate :: S));
58-
PRINT-ATTR RE-COLLECTED (DISPLAY): struct B(identity! ($crate :: S)) ;
5957
PRINT-ATTR INPUT (DEBUG): TokenStream [
6058
Ident {
6159
ident: "struct",

tests/ui/proc-macro/dollar-crate.stdout

-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S);
2-
PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ;
32
PRINT-BANG INPUT (DEBUG): TokenStream [
43
Ident {
54
ident: "struct",
@@ -40,7 +39,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
4039
},
4140
]
4241
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S);
43-
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ;
4442
PRINT-ATTR INPUT (DEBUG): TokenStream [
4543
Ident {
4644
ident: "struct",
@@ -81,7 +79,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
8179
},
8280
]
8381
PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S);
84-
PRINT-DERIVE RE-COLLECTED (DISPLAY): struct D($crate :: S) ;
8582
PRINT-DERIVE INPUT (DEBUG): TokenStream [
8683
Ident {
8784
ident: "struct",
@@ -122,7 +119,6 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
122119
},
123120
]
124121
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S);
125-
PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ;
126122
PRINT-BANG INPUT (DEBUG): TokenStream [
127123
Ident {
128124
ident: "struct",
@@ -163,7 +159,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
163159
},
164160
]
165161
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S);
166-
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ;
167162
PRINT-ATTR INPUT (DEBUG): TokenStream [
168163
Ident {
169164
ident: "struct",
@@ -204,7 +199,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
204199
},
205200
]
206201
PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S);
207-
PRINT-DERIVE RE-COLLECTED (DISPLAY): struct D($crate :: S) ;
208202
PRINT-DERIVE INPUT (DEBUG): TokenStream [
209203
Ident {
210204
ident: "struct",

tests/ui/proc-macro/expand-to-derive.stdout

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
PRINT-DERIVE INPUT (DISPLAY): struct Foo
22
{
33
field :
4-
[bool ; { #[rustc_dummy] struct Inner { other_inner_field: u8, } 0 }]
4+
[bool; { #[rustc_dummy] struct Inner { other_inner_field: u8, } 0 }]
55
}
66
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct Foo
77
{
88
field :
9-
[bool ; { #[rustc_dummy] struct Inner { other_inner_field : u8, } 0 }]
9+
[bool; { #[rustc_dummy] struct Inner { other_inner_field : u8, } 0 }]
1010
}
1111
PRINT-DERIVE INPUT (DEBUG): TokenStream [
1212
Ident {

tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = #[allow(warnings)] 0 ; 0 }, }
2-
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = #[allow(warnings)] #[allow(warnings)] 0 ; 0 }, }
1+
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = #[allow(warnings)] 0; 0 }, }
2+
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = #[allow(warnings)] #[allow(warnings)] 0; 0 }, }
33
PRINT-DERIVE INPUT (DEBUG): TokenStream [
44
Ident {
55
ident: "enum",
@@ -123,7 +123,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
123123
},
124124
]
125125
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0; }; 0 }, }
126-
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 } ; 0 }, }
126+
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 }; 0 }, }
127127
PRINT-DERIVE INPUT (DEBUG): TokenStream [
128128
Ident {
129129
ident: "enum",
@@ -203,7 +203,6 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
203203
},
204204
]
205205
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { {} }; 0 }, }
206-
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { {} } ; 0 }, }
207206
PRINT-DERIVE INPUT (DEBUG): TokenStream [
208207
Ident {
209208
ident: "enum",
@@ -282,7 +281,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
282281
},
283282
]
284283
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH; }; 0 }, }
285-
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH } ; 0 }, }
284+
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH }; 0 }, }
286285
PRINT-DERIVE INPUT (DEBUG): TokenStream [
287286
Ident {
288287
ident: "enum",
@@ -360,7 +359,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
360359
},
361360
]
362361
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 + 1; }; 0 }, }
363-
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 + 1 } ; 0 }, }
362+
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 + 1 }; 0 }, }
364363
PRINT-DERIVE INPUT (DEBUG): TokenStream [
365364
Ident {
366365
ident: "enum",
@@ -451,7 +450,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
451450
},
452451
]
453452
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH + 1; }; 0 }, }
454-
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH + 1 } ; 0 }, }
453+
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH + 1 }; 0 }, }
455454
PRINT-DERIVE INPUT (DEBUG): TokenStream [
456455
Ident {
457456
ident: "enum",

tests/ui/proc-macro/inert-attribute-order.stdout

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ PRINT-ATTR INPUT (DISPLAY): /// 1
22
#[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5] /// 6
33
#[print_attr(nodebug)] struct S;
44
PRINT-ATTR RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5]
5-
#[doc = " 6"] #[print_attr(nodebug)] struct S ;
5+
#[doc = " 6"] #[print_attr(nodebug)] struct S;
66
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"]
7-
#[rustfmt :: attr5] #[doc = " 6"] #[print_attr(nodebug)] struct S ;
7+
#[rustfmt :: attr5] #[doc = " 6"] #[print_attr(nodebug)] struct S;
88
PRINT-ATTR INPUT (DISPLAY): #[doc = " 1"] #[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5]
9-
#[doc = " 6"] struct S ;
9+
#[doc = " 6"] struct S;
1010
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"]
11-
#[rustfmt :: attr5] #[doc = " 6"] struct S ;
11+
#[rustfmt :: attr5] #[doc = " 6"] struct S;

tests/ui/proc-macro/inner-attrs.stdout

+3-8
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
581581
PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint
582582
{ field: [u8; { match true { _ => { #![rustc_dummy(third)] true } }; 0 }] }
583583
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct MyDerivePrint
584-
{
585-
field :
586-
[u8 ; { match true { _ => { #! [rustc_dummy(third)] true } } ; 0 }]
587-
}
584+
{ field : [u8; { match true { _ => { #! [rustc_dummy(third)] true } }; 0 }] }
588585
PRINT-DERIVE INPUT (DEBUG): TokenStream [
589586
Ident {
590587
ident: "struct",
@@ -718,8 +715,7 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
718715
},
719716
]
720717
PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
721-
PRINT-ATTR RE-COLLECTED (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
722-
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
718+
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
723719
PRINT-ATTR INPUT (DEBUG): TokenStream [
724720
Group {
725721
delimiter: Parenthesis,
@@ -834,8 +830,7 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
834830
},
835831
]
836832
PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
837-
PRINT-ATTR RE-COLLECTED (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
838-
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
833+
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
839834
PRINT-ATTR INPUT (DEBUG): TokenStream [
840835
Group {
841836
delimiter: Parenthesis,

tests/ui/proc-macro/input-interpolated.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
55
span: #0 bytes(503..504),
66
},
77
]
8-
PRINT-ATTR INPUT (DISPLAY): const A : u8 = 0 ;
8+
PRINT-ATTR INPUT (DISPLAY): const A : u8 = 0;
99
PRINT-ATTR INPUT (DEBUG): TokenStream [
1010
Ident {
1111
ident: "const",

tests/ui/proc-macro/issue-75734-pp-paren.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PRINT-ATTR INPUT (DISPLAY): fn main() { &|_: u8| {}; mul_2!(1 + 1); }
2-
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn main() { &| _ : u8 | {} ; mul_2! (1 + 1) ; }
2+
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn main() { &| _ : u8 | {}; mul_2! (1 + 1); }
33
PRINT-ATTR INPUT (DEBUG): TokenStream [
44
Ident {
55
ident: "fn",

0 commit comments

Comments
 (0)