about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
diff options
context:
space:
mode:
authorEric Holk <ericholk@microsoft.com>2023-05-19 10:01:49 -0700
committerEric Holk <ericholk@microsoft.com>2023-06-19 12:24:06 -0700
commit53003cdd86592f8a9844eef5060699e981dacf07 (patch)
tree7ab70be1edb0f40d3ebccb27398c1c8e5c9293e8 /compiler/rustc_codegen_gcc/tools/generate_intrinsics.py
parent689511047a75a30825e367d4fd45c74604d0b15e (diff)
downloadrust-53003cdd86592f8a9844eef5060699e981dacf07.tar.gz
rust-53003cdd86592f8a9844eef5060699e981dacf07.zip
Introduce `alloc::::UniqueRc`
This is an `Rc` that is guaranteed to only have one strong reference.
Because it is uniquely owned, it can safely implement `DerefMut`, which
allows programs to have an initialization phase where structures inside
the `Rc` can be mutated.

The `UniqueRc` can then be converted to a regular `Rc`, allowing sharing
and but read-only access.

During the "initialization phase," weak references can be created, but
attempting to upgrade these will fail until the `UniqueRc` has been
converted to a regular `Rc`. This feature can be useful to create
cyclic data structures.

This API is an implementation based on the feedback provided to the ACP
at https://github.com/rust-lang/libs-team/issues/90.
Diffstat (limited to 'compiler/rustc_codegen_gcc/tools/generate_intrinsics.py')
0 files changed, 0 insertions, 0 deletions