Skip to content

Commit 4a0ee3c

Browse files
committed
Auto merge of rust-lang#102387 - nnethercote:inline-Token-PartialEq, r=lqd
Inline a few functions. r? `@ghost`
2 parents b3aa499 + a8d5c00 commit 4a0ee3c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/rustc_ast/src/token.rs

+1
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ impl Token {
728728
}
729729

730730
impl PartialEq<TokenKind> for Token {
731+
#[inline]
731732
fn eq(&self, rhs: &TokenKind) -> bool {
732733
self.kind == *rhs
733734
}

compiler/rustc_span/src/symbol.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1704,6 +1704,7 @@ impl Ident {
17041704
/// macro (e.g., `macro` or `macro_rules!` items) and stay different if they came from different
17051705
/// non-transparent macros.
17061706
/// Technically, this operation strips all transparent marks from ident's syntactic context.
1707+
#[inline]
17071708
pub fn normalize_to_macro_rules(self) -> Ident {
17081709
Ident::new(self.name, self.span.normalize_to_macro_rules())
17091710
}
@@ -1719,6 +1720,7 @@ impl Ident {
17191720
}
17201721

17211722
impl PartialEq for Ident {
1723+
#[inline]
17221724
fn eq(&self, rhs: &Self) -> bool {
17231725
self.name == rhs.name && self.span.eq_ctxt(rhs.span)
17241726
}

0 commit comments

Comments
 (0)