mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Rename Attribute::tokens
(the inherent method).
To distinguish it from the `HasTokens` method.
This commit is contained in:
parent
dd790ab8ef
commit
14b859fa3b
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ impl<'a> StripUnconfigured<'a> {
|
||||
attr: &Attribute,
|
||||
(item, item_span): (ast::AttrItem, Span),
|
||||
) -> Attribute {
|
||||
let orig_tokens = attr.tokens();
|
||||
let orig_tokens = attr.get_tokens();
|
||||
|
||||
// We are taking an attribute of the form `#[cfg_attr(pred, attr)]`
|
||||
// and producing an attribute of the form `#[attr]`. We
|
||||
|
Loading…
Reference in New Issue
Block a user