Tracking Issue for `CovariantUnsafeCell`
Open
@WaffleLapkin is already working on this.
Since Jul 22, 2026.
C-tracking-issue
S-tracking-needs-to-bake
T-libs
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(covariant_unsafe_cell)]
This is a tracking issue for https://github.com/rust-lang/libs-team/issues/815.
Public API
// core::cell
pub struct CovariantUnsafeCell<T: ?Sized> { ... }
impl<T> CovariantUnsafeCell<T> {
pub const fn new(value: T) -> Self { ... }
pub const fn into_inner(self) -> T { ... }
}
impl<T> CovariantUnsafeCell<T> {
pub const fn get(&self) -> NonNull<T> { ... }
pub const fn get_mut(&mut self) -> &mut T { ... }
pub const fn raw_get(this: *const Self) -> *mut T { ... }
}
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: https://github.com/rust-lang/libs-team/issues/815
- Implementation: https://github.com/rust-lang/rust/pull/159738
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- What should be the return type of
get? ACP originally proposed*mut Tas with normalUnsafeCell, but the implementation PR usedNonNull<T>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.