about summary refs log tree commit diff
path: root/compiler/rustc_data_structures
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2024-09-26 20:33:26 -0700
committerJosh Stone <jistone@redhat.com>2024-09-26 20:33:26 -0700
commit4160a54dc5751d08dd23c7e5b0dc6cbc0889ce32 (patch)
treed6bc98cfa79c53f552fd9b86ebeea9b34451c093 /compiler/rustc_data_structures
parent58420a065b68ecb3eec03b942740c761cdadd5c4 (diff)
downloadrust-4160a54dc5751d08dd23c7e5b0dc6cbc0889ce32.tar.gz
rust-4160a54dc5751d08dd23c7e5b0dc6cbc0889ce32.zip
Use `&raw` in the compiler
Like #130865 did for the standard library, we can use `&raw` in the
compiler now that stage0 supports it. Also like the other issue, I did
not make any doc or test changes at this time.
Diffstat (limited to 'compiler/rustc_data_structures')
-rw-r--r--compiler/rustc_data_structures/src/sync.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs
index 6df94bc0e94..a3491dbfec7 100644
--- a/compiler/rustc_data_structures/src/sync.rs
+++ b/compiler/rustc_data_structures/src/sync.rs
@@ -437,7 +437,7 @@ impl<T> RwLock<T> {
     #[inline(always)]
     pub fn leak(&self) -> &T {
         let guard = self.read();
-        let ret = unsafe { &*std::ptr::addr_of!(*guard) };
+        let ret = unsafe { &*(&raw const *guard) };
         std::mem::forget(guard);
         ret
     }