Skip to content

Commit 41434e0

Browse files
committed
avoid shared ref in UnsafeCell::get
1 parent 6b9b97b commit 41434e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/cell.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ impl<T: ?Sized> UnsafeCell<T> {
15091509
#[inline]
15101510
#[stable(feature = "rust1", since = "1.0.0")]
15111511
pub const fn get(&self) -> *mut T {
1512-
&self.value as *const T as *mut T
1512+
self as *const UnsafeCell<T> as *const T as *mut T
15131513
}
15141514
}
15151515

0 commit comments

Comments
 (0)