Skip to content

Commit

Permalink
Auto merge of #102387 - nnethercote:inline-Token-PartialEq, r=lqd
Browse files Browse the repository at this point in the history
Inline a few functions.

r? `@ghost`
  • Loading branch information
bors committed Sep 30, 2022
2 parents b3aa499 + a8d5c00 commit 4a0ee3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ impl Token {
}

impl PartialEq<TokenKind> for Token {
#[inline]
fn eq(&self, rhs: &TokenKind) -> bool {
self.kind == *rhs
}
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand All @@ -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)
}
Expand Down

0 comments on commit 4a0ee3c

Please sign in to comment.