sync-unsafe-cell

Crates.iosync-unsafe-cell
lib.rssync-unsafe-cell
version0.1.1
sourcesrc
created_at2022-05-21 18:54:59.500105
updated_at2023-06-09 05:56:04.965554
descriptionA backport of the SyncUnsafeCell standard library type for use in older Rust versions
homepage
repositoryhttps://gitlab.com/Hawk777/sync-unsafe-cell
max_upload_size
id590816
size16,100
Christopher Head (Hawk777)

documentation

README

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.

Commit count: 3

cargo fmt