Skip to content

Commit

Permalink
Don't insert spaces before most semicolons in print_tts.
Browse files Browse the repository at this point in the history
This gives better output for code produced by proc macros.
  • Loading branch information
nnethercote committed Jan 22, 2024
1 parent ef71f10 commit 41e4a3e
Show file tree
Hide file tree
Showing 26 changed files with 59 additions and 73 deletions.
7 changes: 7 additions & 0 deletions compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ fn space_between(tt1: &TokenTree, tt2: &TokenTree) -> bool {
use TokenTree::Delimited as Del;
use TokenTree::Token as Tok;

fn is_punct(tt: &TokenTree) -> bool {
matches!(tt, TokenTree::Token(tok, _) if tok.is_punct())
}

// Each match arm has one or more examples in comments. The default is to
// insert space between adjacent tokens, except for the cases listed in
// this match.
Expand All @@ -180,6 +184,9 @@ fn space_between(tt1: &TokenTree, tt2: &TokenTree) -> bool {
// - Never type: `Fn() ->!`
(_, Tok(Token { kind: Comma | Dot | Not, .. }, _)) => false,

// NON-PUNCT + `;`: `x = 3;`, `[T; 3]`
(tt1, Tok(Token { kind: Semi, .. }, _)) if !is_punct(tt1) => false,

// IDENT + `(`: `f(3)`
//
// FIXME: Incorrect cases:
Expand Down
2 changes: 1 addition & 1 deletion tests/pretty/delimited-token-groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mac! {
{
fn clone() -> S
{
panic! () ;
panic! ();

}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/pretty/macro_rules.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// pp-exact

macro_rules! brace { () => {} ; }
macro_rules! brace { () => {}; }

macro_rules! bracket[() => {} ;];
macro_rules! bracket[() => {};];

macro_rules! paren(() => {} ;);
macro_rules! paren(() => {};);

macro_rules! matcher_brackets {
(paren) => {} ; (bracket) => {} ; (brace) => {} ;
(paren) => {}; (bracket) => {}; (brace) => {};
}

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

fn main() {}
2 changes: 1 addition & 1 deletion tests/pretty/stmt_expr_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn _8() {
}

fn _9() {
macro_rules! stmt_mac { () => { let _ = () ; } }
macro_rules! stmt_mac { () => { let _ = (); } }

#[rustc_dummy]
stmt_mac!();
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/macros/trace_faulty_macros.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ LL | test!(let x = 1+1);
= note: expanding `test! { let x = 1+1 }`
= note: to `test! ((x, 1 + 1))`
= note: expanding `test! { (x, 1 + 1) }`
= note: to `let x = 1 + 1 ;`
= note: to `let x = 1 + 1;`

error: aborting due to 5 previous errors

Expand Down
7 changes: 2 additions & 5 deletions tests/ui/proc-macro/allowed-attr-stmt-expr.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PRINT-ATTR INPUT (DISPLAY): struct ItemWithSemi;
PRINT-ATTR RE-COLLECTED (DISPLAY): struct ItemWithSemi ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -47,7 +46,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!";
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_let] let string = "Hello, world!" ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
Expand Down Expand Up @@ -90,7 +88,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro!("{}", string);
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ;
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string);
PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
Expand Down Expand Up @@ -144,7 +142,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): second_make_stmt!(#[allow(dead_code)] struct Bar {});
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ;
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {});
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "second_make_stmt",
Expand Down Expand Up @@ -293,7 +291,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): #[rustc_dummy] struct NonBracedStruct;
PRINT-ATTR RE-COLLECTED (DISPLAY): #[rustc_dummy] struct NonBracedStruct ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
Expand Down
5 changes: 2 additions & 3 deletions tests/ui/proc-macro/attr-stmt-expr.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): #[expect_let] let string = "Hello, world!";
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_let] let string = "Hello, world!" ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
Expand Down Expand Up @@ -73,7 +72,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): #[expect_my_macro_stmt] my_macro!("{}", string);
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string) ;
PRINT-ATTR RE-COLLECTED (DISPLAY): #[expect_my_macro_stmt] my_macro! ("{}", string);
PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
Expand Down Expand Up @@ -127,7 +126,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): second_make_stmt!(#[allow(dead_code)] struct Bar {});
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {}) ;
PRINT-ATTR RE-COLLECTED (DISPLAY): second_make_stmt! (#[allow(dead_code)] struct Bar {});
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "second_make_stmt",
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/attribute-spans-preserved.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fn main() { let y : u32 = "z" ; { let x: u32 = "y"; } }
fn main() { let y : u32 = "z"; { let x: u32 = "y"; } }
4 changes: 2 additions & 2 deletions tests/ui/proc-macro/auxiliary/attr-stmt-expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn expect_let(attr: TokenStream, item: TokenStream) -> TokenStream {
assert!(attr.to_string().is_empty());
assert_eq!(item.to_string(), "let string = \"Hello, world!\" ;");
assert_eq!(item.to_string(), "let string = \"Hello, world!\";");
item
}

#[proc_macro_attribute]
pub fn expect_my_macro_stmt(attr: TokenStream, item: TokenStream) -> TokenStream {
assert!(attr.to_string().is_empty());
assert_eq!(item.to_string(), "my_macro! (\"{}\", string) ;");
assert_eq!(item.to_string(), "my_macro! (\"{}\", string);");
item
}

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/proc-macro/cfg-eval-inner.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ PRINT-ATTR RE-COLLECTED (DISPLAY): impl Foo <
{ field: [u8; { #![rustc_dummy(another_cursed_inner)] 1 }] } 0
}] > { #![rustc_dummy(evaluated_attr)] fn bar() {} }
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl Foo <
[u8 ;
[u8;
{
#! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
{ field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
{ field : [u8; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
}] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/doc-comment-preserved.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PRINT-BANG INPUT (DISPLAY): /**
*******
*/
pub struct S;
PRINT-BANG RE-COLLECTED (DISPLAY): #[doc = "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n"] pub struct S ;
PRINT-BANG RE-COLLECTED (DISPLAY): #[doc = "\n*******\n* DOC *\n* DOC *\n* DOC *\n*******\n"] pub struct S;
PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/proc-macro/dollar-crate-issue-57089.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S);
PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ;
PRINT-BANG INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -40,7 +39,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S);
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/proc-macro/dollar-crate-issue-62325.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PRINT-ATTR INPUT (DISPLAY): struct A(identity! ($crate :: S));
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A(identity! ($crate :: S)) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -55,7 +54,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): struct B(identity! ($crate :: S));
PRINT-ATTR RE-COLLECTED (DISPLAY): struct B(identity! ($crate :: S)) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down
6 changes: 0 additions & 6 deletions tests/ui/proc-macro/dollar-crate.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S);
PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ;
PRINT-BANG INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -40,7 +39,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S);
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -81,7 +79,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S);
PRINT-DERIVE RE-COLLECTED (DISPLAY): struct D($crate :: S) ;
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -122,7 +119,6 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
},
]
PRINT-BANG INPUT (DISPLAY): struct M($crate :: S);
PRINT-BANG RE-COLLECTED (DISPLAY): struct M($crate :: S) ;
PRINT-BANG INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -163,7 +159,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): struct A($crate :: S);
PRINT-ATTR RE-COLLECTED (DISPLAY): struct A($crate :: S) ;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -204,7 +199,6 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
},
]
PRINT-DERIVE INPUT (DISPLAY): struct D($crate :: S);
PRINT-DERIVE RE-COLLECTED (DISPLAY): struct D($crate :: S) ;
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/proc-macro/expand-to-derive.stdout
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PRINT-DERIVE INPUT (DISPLAY): struct Foo
{
field :
[bool ; { #[rustc_dummy] struct Inner { other_inner_field: u8, } 0 }]
[bool; { #[rustc_dummy] struct Inner { other_inner_field: u8, } 0 }]
}
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct Foo
{
field :
[bool ; { #[rustc_dummy] struct Inner { other_inner_field : u8, } 0 }]
[bool; { #[rustc_dummy] struct Inner { other_inner_field : u8, } 0 }]
}
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
Expand Down
13 changes: 6 additions & 7 deletions tests/ui/proc-macro/expr-stmt-nonterminal-tokens.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = #[allow(warnings)] 0 ; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = #[allow(warnings)] #[allow(warnings)] 0 ; 0 }, }
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = #[allow(warnings)] 0; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = #[allow(warnings)] #[allow(warnings)] 0; 0 }, }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
Expand Down Expand Up @@ -123,7 +123,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
},
]
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0; }; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 } ; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 }; 0 }, }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
Expand Down Expand Up @@ -203,7 +203,6 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
},
]
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { {} }; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { {} } ; 0 }, }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
Expand Down Expand Up @@ -282,7 +281,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
},
]
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH; }; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH } ; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH }; 0 }, }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
Expand Down Expand Up @@ -360,7 +359,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
},
]
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { 0 + 1; }; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 + 1 } ; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { 0 + 1 }; 0 }, }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
Expand Down Expand Up @@ -451,7 +450,7 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
},
]
PRINT-DERIVE INPUT (DISPLAY): enum E { V = { let _ = { PATH + 1; }; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH + 1 } ; 0 }, }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): enum E { V = { let _ = { PATH + 1 }; 0 }, }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/proc-macro/inert-attribute-order.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ PRINT-ATTR INPUT (DISPLAY): /// 1
#[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5] /// 6
#[print_attr(nodebug)] struct S;
PRINT-ATTR RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5]
#[doc = " 6"] #[print_attr(nodebug)] struct S ;
#[doc = " 6"] #[print_attr(nodebug)] struct S;
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"]
#[rustfmt :: attr5] #[doc = " 6"] #[print_attr(nodebug)] struct S ;
#[rustfmt :: attr5] #[doc = " 6"] #[print_attr(nodebug)] struct S;
PRINT-ATTR INPUT (DISPLAY): #[doc = " 1"] #[rustfmt::attr2] #[doc = "3"] #[doc = "4"] #[rustfmt::attr5]
#[doc = " 6"] struct S ;
#[doc = " 6"] struct S;
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"]
#[rustfmt :: attr5] #[doc = " 6"] struct S ;
#[rustfmt :: attr5] #[doc = " 6"] struct S;
11 changes: 3 additions & 8 deletions tests/ui/proc-macro/inner-attrs.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,7 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint
{ field: [u8; { match true { _ => { #![rustc_dummy(third)] true } }; 0 }] }
PRINT-DERIVE DEEP-RE-COLLECTED (DISPLAY): struct MyDerivePrint
{
field :
[u8 ; { match true { _ => { #! [rustc_dummy(third)] true } } ; 0 }]
}
{ field : [u8; { match true { _ => { #! [rustc_dummy(third)] true } }; 0 }] }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
Expand Down Expand Up @@ -718,8 +715,7 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
PRINT-ATTR RE-COLLECTED (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
PRINT-ATTR INPUT (DEBUG): TokenStream [
Group {
delimiter: Parenthesis,
Expand Down Expand Up @@ -834,8 +830,7 @@ PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
},
]
PRINT-ATTR INPUT (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
PRINT-ATTR RE-COLLECTED (DISPLAY): (3, 4, { #![cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 });
PRINT-ATTR INPUT (DEBUG): TokenStream [
Group {
delimiter: Parenthesis,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/input-interpolated.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
span: #0 bytes(503..504),
},
]
PRINT-ATTR INPUT (DISPLAY): const A : u8 = 0 ;
PRINT-ATTR INPUT (DISPLAY): const A : u8 = 0;
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "const",
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/proc-macro/issue-75734-pp-paren.stdout
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PRINT-ATTR INPUT (DISPLAY): fn main() { &|_: u8| {}; mul_2!(1 + 1); }
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn main() { &| _ : u8 | {} ; mul_2! (1 + 1) ; }
PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): fn main() { &| _ : u8 | {}; mul_2! (1 + 1); }
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "fn",
Expand Down
Loading

0 comments on commit 41e4a3e

Please sign in to comment.