mirror of https://github.com/rust-lang/rust.git
Auto merge of #102387 - nnethercote:inline-Token-PartialEq, r=lqd
Inline a few functions. r? `@ghost`
This commit is contained in:
commit
4a0ee3cdc6
|
@ -728,6 +728,7 @@ impl Token {
|
|||
}
|
||||
|
||||
impl PartialEq<TokenKind> for Token {
|
||||
#[inline]
|
||||
fn eq(&self, rhs: &TokenKind) -> bool {
|
||||
self.kind == *rhs
|
||||
}
|
||||
|
|
|
@ -1704,6 +1704,7 @@ impl Ident {
|
|||
/// macro (e.g., `macro` or `macro_rules!` items) and stay different if they came from different
|
||||
/// non-transparent macros.
|
||||
/// Technically, this operation strips all transparent marks from ident's syntactic context.
|
||||
#[inline]
|
||||
pub fn normalize_to_macro_rules(self) -> Ident {
|
||||
Ident::new(self.name, self.span.normalize_to_macro_rules())
|
||||
}
|
||||
|
@ -1719,6 +1720,7 @@ impl Ident {
|
|||
}
|
||||
|
||||
impl PartialEq for Ident {
|
||||
#[inline]
|
||||
fn eq(&self, rhs: &Self) -> bool {
|
||||
self.name == rhs.name && self.span.eq_ctxt(rhs.span)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue