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.
This commit is contained in:
parent
58420a065b
commit
4160a54dc5
7 changed files with 13 additions and 13 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue