about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-09-27 19:08:00 +0200
committerGitHub <noreply@github.com>2024-09-27 19:08:00 +0200
commita37f7f457faf81ae5e2edc8e18b1720ddb0b9ec2 (patch)
treea6b592ad75e0ddf75901b8027bb04a29c1f55b51 /compiler/rustc_data_structures/src
parentfd9d961ed803a4ee5e9943c0e8c24acde528a56d (diff)
parent4160a54dc5751d08dd23c7e5b0dc6cbc0889ce32 (diff)
downloadrust-a37f7f457faf81ae5e2edc8e18b1720ddb0b9ec2.tar.gz
rust-a37f7f457faf81ae5e2edc8e18b1720ddb0b9ec2.zip
Rollup merge of #130916 - cuviper:compiler-raw_ref_op, r=compiler-errors
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/src')
-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
     }