Skip to content

Commit

Permalink
Use JointHidden in a couple of suitable places.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nnethercote committed May 17, 2024
1 parent 3b977bb commit 560fe01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,11 @@ impl TokenStream {
if attr_style == AttrStyle::Inner {
vec![
TokenTree::token_joint(token::Pound, span),
TokenTree::token_alone(token::Not, span),
TokenTree::token_joint_hidden(token::Not, span),
body,
]
} else {
vec![TokenTree::token_alone(token::Pound, span), body]
vec![TokenTree::token_joint_hidden(token::Pound, span), body]
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/proc-macro/issue-78675-captured-inner-attrs.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PRINT-BANG INPUT (DISPLAY): foo! { #[fake_attr] mod bar { #! [doc = r" Foo"] } }
PRINT-BANG INPUT (DISPLAY): foo! { #[fake_attr] mod bar { #![doc = r" Foo"] } }
PRINT-BANG DEEP-RE-COLLECTED (DISPLAY): foo! { #[fake_attr] mod bar { #! [doc = r" Foo"] } }
PRINT-BANG INPUT (DEBUG): TokenStream [
Ident {
ident: "foo",
Expand Down

0 comments on commit 560fe01

Please sign in to comment.