1
Fork 0

Introduce language items for Arc and Rc.

This commit introduces language items for `Arc` and `Rc` so that types
can later be checked to be `Arc` or `Rc` in the NLL borrow checker. The
`lang` attribute is currently limited to `stage1` as it requires a
compiler built with knowledge of the expected language items.
This commit is contained in:
David Wood 2018-09-30 21:19:55 +02:00
parent 1886d5fe1c
commit da4a12038b
No known key found for this signature in database
GPG key ID: 01760B4F9F53F154
6 changed files with 44 additions and 1 deletions

View file

@ -199,6 +199,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
/// counting in general.
///
/// [rc_examples]: ../../std/rc/index.html#examples
#[cfg_attr(all(not(stage0), not(test)), lang = "arc")]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Arc<T: ?Sized> {
ptr: NonNull<ArcInner<T>>,