Skip to content

Commit

Permalink
Add #[inline] to some new functions
Browse files Browse the repository at this point in the history
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
  • Loading branch information
saethlin and cjgillot authored Apr 18, 2023
1 parent a04c09a commit 073d99b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_data_structures/src/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ pub trait FingerprintComponent {
}

impl FingerprintComponent for Hash64 {
#[inline]
fn as_u64(&self) -> u64 {
Hash64::as_u64(*self)
}
}

impl FingerprintComponent for u64 {
#[inline]
fn as_u64(&self) -> u64 {
*self
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_data_structures/src/hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl Hash64 {
}

impl BitXorAssign<u64> for Hash64 {
#[inline]
fn bitxor_assign(&mut self, rhs: u64) {
self.inner ^= rhs;
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ impl StableCrateId {
StableCrateId(hasher.finish())
}

#[inline]
pub fn as_u64(self) -> u64 {
self.0.as_u64()
}
Expand Down

0 comments on commit 073d99b

Please sign in to comment.