about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-08-21 15:32:57 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-08-23 14:40:08 +1000
commitdeab741ab4c91c740b265db4d4950f31fc4f6cc3 (patch)
tree494f94cd371b98dfe1808111d272b56ddfe02cce /compiler/rustc_parse/src/parser
parent6b678c57b63b3062fb97130b3617b82657f59c80 (diff)
downloadrust-deab741ab4c91c740b265db4d4950f31fc4f6cc3.tar.gz
rust-deab741ab4c91c740b265db4d4950f31fc4f6cc3.zip
Clarify a comment.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/attr_wrapper.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/attr_wrapper.rs b/compiler/rustc_parse/src/parser/attr_wrapper.rs
index 49df2811d52..cfbac4876d5 100644
--- a/compiler/rustc_parse/src/parser/attr_wrapper.rs
+++ b/compiler/rustc_parse/src/parser/attr_wrapper.rs
@@ -510,9 +510,11 @@ fn make_attr_token_stream(
 }
 
 /// Tokens are needed if:
-/// - any non-single-segment attributes (other than doc comments) are present; or
-/// - any `cfg_attr` attributes are present;
-/// - any single-segment, non-builtin attributes are present.
+/// - any non-single-segment attributes (other than doc comments) are present,
+///   e.g. `rustfmt::skip`; or
+/// - any `cfg_attr` attributes are present; or
+/// - any single-segment, non-builtin attributes are present, e.g. `derive`,
+///   `test`, `global_allocator`.
 fn needs_tokens(attrs: &[ast::Attribute]) -> bool {
     attrs.iter().any(|attr| match attr.ident() {
         None => !attr.is_doc_comment(),