about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-10-11 17:16:04 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-12 08:46:16 +1100
commit33aff5b1523b64052ae580f9bb6c7a7de94f16c5 (patch)
tree705d42dcfef8786143d992512ce3266e2db6516f
parentbb9c2f50c378d494e14f5d3062ed88ea90749637 (diff)
downloadrust-33aff5b1523b64052ae580f9bb6c7a7de94f16c5.tar.gz
rust-33aff5b1523b64052ae580f9bb6c7a7de94f16c5.zip
Use `TokenStream::token_alone` in one place.
-rw-r--r--compiler/rustc_ast/src/attr/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs
index db008ea139d..7b7078fabbb 100644
--- a/compiler/rustc_ast/src/attr/mod.rs
+++ b/compiler/rustc_ast/src/attr/mod.rs
@@ -197,10 +197,10 @@ impl Attribute {
                 .unwrap_or_else(|| panic!("attribute is missing tokens: {self:?}"))
                 .to_attr_token_stream()
                 .to_tokenstream(),
-            &AttrKind::DocComment(comment_kind, data) => TokenStream::new(vec![TokenTree::Token(
-                Token::new(token::DocComment(comment_kind, self.style, data), self.span),
-                Spacing::Alone,
-            )]),
+            &AttrKind::DocComment(comment_kind, data) => TokenStream::token_alone(
+                token::DocComment(comment_kind, self.style, data),
+                self.span,
+            ),
         }
     }
 }