From f7256d28d1c2f8340ab5b99df4bdb15aa232f3f3 Mon Sep 17 00:00:00 2001 From: Ross MacArthur Date: Sat, 21 Dec 2019 13:16:18 +0200 Subject: Require issue = "none" over issue = "0" in unstable attributes --- src/liballoc/sync.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/liballoc/sync.rs') diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index a99564c0dac..88027d48e8a 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -206,7 +206,7 @@ unsafe impl Sync for Arc {} #[unstable(feature = "coerce_unsized", issue = "27732")] impl, U: ?Sized> CoerceUnsized> for Arc {} -#[unstable(feature = "dispatch_from_dyn", issue = "0")] +#[unstable(feature = "dispatch_from_dyn", issue = "none")] impl, U: ?Sized> DispatchFromDyn> for Arc {} impl Arc { @@ -263,7 +263,7 @@ unsafe impl Sync for Weak {} #[unstable(feature = "coerce_unsized", issue = "27732")] impl, U: ?Sized> CoerceUnsized> for Weak {} -#[unstable(feature = "dispatch_from_dyn", issue = "0")] +#[unstable(feature = "dispatch_from_dyn", issue = "none")] impl, U: ?Sized> DispatchFromDyn> for Weak {} #[stable(feature = "arc_weak", since = "1.4.0")] @@ -993,7 +993,7 @@ impl Deref for Arc { } } -#[unstable(feature = "receiver_trait", issue = "0")] +#[unstable(feature = "receiver_trait", issue = "none")] impl Receiver for Arc {} impl Arc { @@ -2032,7 +2032,7 @@ impl From> for Arc<[T]> { } } -#[unstable(feature = "boxed_slice_try_from", issue = "0")] +#[unstable(feature = "boxed_slice_try_from", issue = "none")] impl TryFrom> for Arc<[T; N]> where [T; N]: LengthAtMost32, -- cgit 1.4.1-3-g733a5 From a34c2677afeee2747d680536f302a8c5665a65f4 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sat, 21 Dec 2019 20:35:41 -0500 Subject: Warn against relying on ?Sized being last --- src/liballoc/rc.rs | 2 ++ src/liballoc/sync.rs | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src/liballoc/sync.rs') diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 42a278de98b..00c4b5462be 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -2106,6 +2106,8 @@ impl Unpin for Rc { } unsafe fn data_offset(ptr: *const T) -> isize { // Align the unsized value to the end of the `RcBox`. // Because it is ?Sized, it will always be the last field in memory. + // Note: This is a detail of the current implementation of the compiler, + // and is not a guaranteed language detail. Do not rely on it outside of std. data_offset_align(align_of_val(&*ptr)) } diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index a99564c0dac..37995a7ec79 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -2161,6 +2161,8 @@ impl Unpin for Arc { } unsafe fn data_offset(ptr: *const T) -> isize { // Align the unsized value to the end of the `ArcInner`. // Because it is `?Sized`, it will always be the last field in memory. + // Note: This is a detail of the current implementation of the compiler, + // and is not a guaranteed language detail. Do not rely on it outside of std. data_offset_align(align_of_val(&*ptr)) } -- cgit 1.4.1-3-g733a5