diff options
| author | bors <bors@rust-lang.org> | 2024-02-24 23:08:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-24 23:08:21 +0000 |
| commit | 2ae1bb671183a072b54ed8ed39abfcd72990a3e7 (patch) | |
| tree | d805240f98f1629af08a6426ede14aeca34dd064 /compiler/rustc_data_structures/src | |
| parent | 381d69953bb7c3390cec0fee200f24529cb6320f (diff) | |
| parent | 4c401531f5f2e237954705d74ae06c6ec0996755 (diff) | |
| download | rust-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.rs | 2 |
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 } |
