Skip to content

Commit 073d99b

Browse files
saethlincjgillot
andauthored
Add #[inline] to some new functions
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
1 parent a04c09a commit 073d99b

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

compiler/rustc_data_structures/src/fingerprint.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ pub trait FingerprintComponent {
1414
}
1515

1616
impl FingerprintComponent for Hash64 {
17+
#[inline]
1718
fn as_u64(&self) -> u64 {
1819
Hash64::as_u64(*self)
1920
}
2021
}
2122

2223
impl FingerprintComponent for u64 {
24+
#[inline]
2325
fn as_u64(&self) -> u64 {
2426
*self
2527
}

compiler/rustc_data_structures/src/hashes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ impl Hash64 {
3636
}
3737

3838
impl BitXorAssign<u64> for Hash64 {
39+
#[inline]
3940
fn bitxor_assign(&mut self, rhs: u64) {
4041
self.inner ^= rhs;
4142
}

compiler/rustc_span/src/def_id.rs

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ impl StableCrateId {
186186
StableCrateId(hasher.finish())
187187
}
188188

189+
#[inline]
189190
pub fn as_u64(self) -> u64 {
190191
self.0.as_u64()
191192
}

0 commit comments

Comments
 (0)