about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-24 23:08:21 +0000
committerbors <bors@rust-lang.org>2024-02-24 23:08:21 +0000
commit2ae1bb671183a072b54ed8ed39abfcd72990a3e7 (patch)
treed805240f98f1629af08a6426ede14aeca34dd064 /compiler/rustc_data_structures/src
parent381d69953bb7c3390cec0fee200f24529cb6320f (diff)
parent4c401531f5f2e237954705d74ae06c6ec0996755 (diff)
downloadrust-2ae1bb671183a072b54ed8ed39abfcd72990a3e7.tar.gz
rust-2ae1bb671183a072b54ed8ed39abfcd72990a3e7.zip
Auto merge of #121569 - matthiaskrgr:rollup-awglrax, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #121343 (Add examples for some methods on slices)
 - #121374 (match lowering: Split off `test_candidates` into several functions and improve comments)
 - #121474 (Ignore compiletest test directive migration commits)
 - #121515 (promotion: don't promote int::MIN / -1)
 - #121530 (Fix incorrect doc of ScopedJoinHandle::is_finished)
 - #121551 (Forbid use of `extern "C-unwind"` inside standard library)
 - #121556 (Use `addr_of!`)

r? `@ghost`
`@rustbot` modify labels: rollup
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 adcb6ceaebf..32202ac3ede 100644
--- a/compiler/rustc_data_structures/src/sync.rs
+++ b/compiler/rustc_data_structures/src/sync.rs
@@ -429,7 +429,7 @@ impl<T> RwLock<T> {
     #[inline(always)]
     pub fn leak(&self) -> &T {
         let guard = self.read();
-        let ret = unsafe { &*(&*guard as *const T) };
+        let ret = unsafe { &*std::ptr::addr_of!(*guard) };
         std::mem::forget(guard);
         ret
     }