about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorDavid Wood <david@davidtw.co>2018-09-30 21:19:55 +0200
committerDavid Wood <david@davidtw.co>2018-10-01 13:50:21 +0200
commitda4a12038bac647b8d07211588c21f1ca07c12e3 (patch)
treee739f669e9665a433a53a16f9062e325450cff3f /src/liballoc
parent1886d5fe1cdd1a016ecea9fc93d68b3052c528c8 (diff)
downloadrust-da4a12038bac647b8d07211588c21f1ca07c12e3.tar.gz
rust-da4a12038bac647b8d07211588c21f1ca07c12e3.zip
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.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/rc.rs1
-rw-r--r--src/liballoc/sync.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 9d951691a34..915b8e7787e 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -282,6 +282,7 @@ struct RcBox<T: ?Sized> {
 /// type `T`.
 ///
 /// [get_mut]: #method.get_mut
+#[cfg_attr(all(not(stage0), not(test)), lang = "rc")]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct Rc<T: ?Sized> {
     ptr: NonNull<RcBox<T>>,
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs
index 116393bdad1..9e245fbd7bb 100644
--- a/src/liballoc/sync.rs
+++ b/src/liballoc/sync.rs
@@ -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>>,