summary refs log tree commit diff
path: root/compiler/rustc_ast/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-07-04 09:04:51 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-07-07 15:58:10 +1000
commit14b859fa3be22289d810df1cc8bd2aaf6fc299be (patch)
tree2de40ad69e000fbdcd93f22bd123f18003e0be1d /compiler/rustc_ast/src
parentdd790ab8ef8cc2a89f04f2be73c86230595a48a3 (diff)
downloadrust-14b859fa3be22289d810df1cc8bd2aaf6fc299be.tar.gz
rust-14b859fa3be22289d810df1cc8bd2aaf6fc299be.zip
Rename `Attribute::tokens` (the inherent method).
To distinguish it from the `HasTokens` method.
Diffstat (limited to 'compiler/rustc_ast/src')
-rw-r--r--compiler/rustc_ast/src/attr/mod.rs3
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs4
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs
index 65f1b5dbaf5..088ae9ba441 100644
--- a/compiler/rustc_ast/src/attr/mod.rs
+++ b/compiler/rustc_ast/src/attr/mod.rs
@@ -202,7 +202,8 @@ impl Attribute {
         }
     }
 
-    pub fn tokens(&self) -> TokenStream {
+    // Named `get_tokens` to distinguish it from the `<Attribute as HasTokens>::tokens` method.
+    pub fn get_tokens(&self) -> TokenStream {
         match &self.kind {
             AttrKind::Normal(normal) => TokenStream::new(
                 normal
diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs
index 655c18e4559..06a669e7957 100644
--- a/compiler/rustc_ast/src/tokenstream.rs
+++ b/compiler/rustc_ast/src/tokenstream.rs
@@ -227,7 +227,7 @@ impl AttrTokenStream {
 
                                 let mut stream = TokenStream::default();
                                 for inner_attr in inner_attrs {
-                                    stream.push_stream(inner_attr.tokens());
+                                    stream.push_stream(inner_attr.get_tokens());
                                 }
                                 stream.push_stream(delim_tokens.clone());
                                 *tree = TokenTree::Delimited(*span, *spacing, *delim, stream);
@@ -242,7 +242,7 @@ impl AttrTokenStream {
                         );
                     }
                     for attr in outer_attrs {
-                        res.extend(attr.tokens().0.iter().cloned());
+                        res.extend(attr.get_tokens().0.iter().cloned());
                     }
                     res.extend(target_tokens);
                 }