Crates.io | sync-unsafe-cell |
lib.rs | sync-unsafe-cell |
version | 0.1.1 |
source | src |
created_at | 2022-05-21 18:54:59.500105 |
updated_at | 2023-06-09 05:56:04.965554 |
description | A backport of the SyncUnsafeCell standard library type for use in older Rust versions |
homepage | |
repository | https://gitlab.com/Hawk777/sync-unsafe-cell |
max_upload_size | |
id | 590816 |
size | 16,100 |
This is a backport of the SyncUnsafeCell
type from the standard library. The
backport allows it to be used in older Rust versions, where it either does not
exist yet or is not stable. Its minimum supported Rust version is 1.59, though
it may work with older versions too.
A few changes have been made accordingly:
UnsafeCell::into_inner
is not stably const
, so
SyncUnsafeCell::into_inner
is also not const
.const_mut_refs
is not stable, so SyncUnsafeCell::get_mut
is not const
.CoerceUnsized
is not stable, so SyncUnsafeCell
does not implement it.Thanks to Mara Bos (m-ou-se) for the standard library implementation of which this is a copy.