View all comments
Feature gate: #![feature(sync_unsafe_cell)]
This is a tracking issue for SyncUnsafeCell.
Public API
// core::cell
#[repr(transparent)]
pub struct SyncUnsafeCell<T: ?Sized> {
value: UnsafeCell<T>,
}
// Bound `T: Sync`, unresolved if we want this
unsafe impl<T: ?Sized + Sync> Sync for SyncUnsafeCell<T> {}
// Identical interface as UnsafeCell:
impl<T> SyncUnsafeCell<T> {
pub const fn new(value: T) -> Self;
pub const fn into_inner(self) -> T;
}
impl<T: ?Sized> SyncUnsafeCell<T> {
pub const fn get(&self) -> *mut T;
pub const fn get_mut(&mut self) -> &mut T;
pub const fn raw_get(this: *const Self) -> *mut T;
}
impl<T> From<T> for SyncUnsafeCell<T>;
impl<T: Default> Default for SyncUnsafeCell<T>;
impl<T: ?Sized> Debug for SyncUnsafeCell<T>;
Steps / History
Unresolved Questions
View all comments
Feature gate:
#![feature(sync_unsafe_cell)]This is a tracking issue for SyncUnsafeCell.
Public API
Steps / History
Unresolved Questions
Synconly ifTisSync, or should it unconditionally beSync?AssertThreadSafe(name TBD) – a more general API for lifting conservative!Sendor!Syncimplementations libs-team#322UnsafeCellin shared statics #152540