Skip to content

Commit 77fd84a

Browse files
committed
Tag SyncUnsafeCell functions with #[rustc_as_ptr]
1 parent 5fbf391 commit 77fd84a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/core/src/cell.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,7 @@ impl<T: ?Sized> SyncUnsafeCell<T> {
23062306
/// when casting to `&mut T`, and ensure that there are no mutations
23072307
/// or mutable aliases going on when casting to `&T`
23082308
#[inline]
2309+
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
23092310
#[rustc_never_returns_null_ptr]
23102311
pub const fn get(&self) -> *mut T {
23112312
self.value.get()
@@ -2323,6 +2324,7 @@ impl<T: ?Sized> SyncUnsafeCell<T> {
23232324
/// Gets a mutable pointer to the wrapped value.
23242325
///
23252326
/// See [`UnsafeCell::get`] for details.
2327+
#[cfg_attr(not(bootstrap), rustc_as_ptr)]
23262328
#[inline]
23272329
pub const fn raw_get(this: *const Self) -> *mut T {
23282330
// We can just cast the pointer from `SyncUnsafeCell<T>` to `T` because

0 commit comments

Comments
 (0)