diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2021-12-08 21:08:44 +0800 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2021-12-12 12:35:01 +0800 |
| commit | 83587e8d307a765b940957dad01706b1d97a2090 (patch) | |
| tree | 1776be5a062fcb811cbac4c341868c0ab5dd54b3 /compiler/rustc_data_structures/src | |
| parent | 17b53b964567b948c08cf04b9571d62146597ae3 (diff) | |
| download | rust-83587e8d307a765b940957dad01706b1d97a2090.tar.gz rust-83587e8d307a765b940957dad01706b1d97a2090.zip | |
Small performance tweaks
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/tagged_ptr/copy.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/tagged_ptr/copy.rs b/compiler/rustc_data_structures/src/tagged_ptr/copy.rs index d63bcdb3c2b..e1d3e0bd35a 100644 --- a/compiler/rustc_data_structures/src/tagged_ptr/copy.rs +++ b/compiler/rustc_data_structures/src/tagged_ptr/copy.rs @@ -94,9 +94,11 @@ where // SAFETY: pointer_raw returns the original pointer unsafe { std::mem::transmute_copy(&self.pointer_raw()) } } + #[inline] pub fn tag(&self) -> T { unsafe { T::from_usize(self.packed.get() >> Self::TAG_BIT_SHIFT) } } + #[inline] pub fn set_tag(&mut self, tag: T) { let mut packed = self.packed.get(); let new_tag = T::into_usize(tag) << Self::TAG_BIT_SHIFT; |
