Auto merge of #102387 - nnethercote:inline-Token-PartialEq, r=lqd

Inline a few functions.

r? `@ghost`
This commit is contained in:
bors 2022-09-30 07:57:12 +00:00
commit 4a0ee3cdc6
2 changed files with 3 additions and 0 deletions

View File

@ -728,6 +728,7 @@ impl Token {
}
impl PartialEq<TokenKind> for Token {
#[inline]
fn eq(&self, rhs: &TokenKind) -> bool {
self.kind == *rhs
}

View File

@ -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)
}