Skip to content

Commit 560fe01

Browse files
committed
Use JointHidden in a couple of suitable places.
This improves the `INPUT` output of one test. The `DEEP-RE-COLLECTED` output is unchanged because the `JointHidden` gets converted to `Alone` when it goes in and out of the proc macro.
1 parent 3b977bb commit 560fe01

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/rustc_ast/src/tokenstream.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,11 @@ impl TokenStream {
661661
if attr_style == AttrStyle::Inner {
662662
vec![
663663
TokenTree::token_joint(token::Pound, span),
664-
TokenTree::token_alone(token::Not, span),
664+
TokenTree::token_joint_hidden(token::Not, span),
665665
body,
666666
]
667667
} else {
668-
vec![TokenTree::token_alone(token::Pound, span), body]
668+
vec![TokenTree::token_joint_hidden(token::Pound, span), body]
669669
}
670670
}
671671
}

tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
PRINT-BANG INPUT (DISPLAY): foo! { #[fake_attr] mod bar { #! [doc = r" Foo"] } }
1+
PRINT-BANG INPUT (DISPLAY): foo! { #[fake_attr] mod bar { #![doc = r" Foo"] } }
2+
PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): foo! { #[fake_attr] mod bar { #! [doc = r" Foo"] } }
23
PRINT-BANG INPUT (DEBUG): TokenStream [
34
Ident {
45
ident: "foo",

0 commit comments

Comments
 (0)