diff options
| author | Stjepan Glavina <stjepang@gmail.com> | 2018-05-21 17:59:20 +0200 |
|---|---|---|
| committer | Stjepan Glavina <stjepang@gmail.com> | 2018-05-21 18:16:08 +0200 |
| commit | 26d62f55a40db77c6bca85ad56a44aee898096a5 (patch) | |
| tree | d4b12cd2c615e29d95a13c11ded399dee582bf44 | |
| parent | 6e6a4b1957e2407563f3c9005504f95138ffe28f (diff) | |
| download | rust-26d62f55a40db77c6bca85ad56a44aee898096a5.tar.gz rust-26d62f55a40db77c6bca85ad56a44aee898096a5.zip | |
Stabilize feature from_ref
| -rw-r--r-- | src/liballoc/slice.rs | 4 | ||||
| -rw-r--r-- | src/libcore/slice/mod.rs | 6 | ||||
| -rw-r--r-- | src/librustc/mir/mod.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 4427ac004f9..161493f3892 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -119,8 +119,8 @@ pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut}; pub use core::slice::{RSplit, RSplitMut}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::slice::{from_raw_parts, from_raw_parts_mut}; -#[unstable(feature = "from_ref", issue = "45703")] -pub use core::slice::{from_ref, from_ref_mut}; +#[stable(feature = "from_ref", since = "1.28.0")] +pub use core::slice::{from_ref, from_mut}; #[unstable(feature = "slice_get_slice", issue = "35729")] pub use core::slice::SliceIndex; #[unstable(feature = "exact_chunks", issue = "47115")] diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 3b19a401859..6278da85e9b 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -3874,7 +3874,7 @@ pub unsafe fn from_raw_parts_mut<'a, T>(p: *mut T, len: usize) -> &'a mut [T] { } /// Converts a reference to T into a slice of length 1 (without copying). -#[unstable(feature = "from_ref", issue = "45703")] +#[stable(feature = "from_ref", since = "1.28.0")] pub fn from_ref<T>(s: &T) -> &[T] { unsafe { from_raw_parts(s, 1) @@ -3882,8 +3882,8 @@ pub fn from_ref<T>(s: &T) -> &[T] { } /// Converts a reference to T into a slice of length 1 (without copying). -#[unstable(feature = "from_ref", issue = "45703")] -pub fn from_ref_mut<T>(s: &mut T) -> &mut [T] { +#[stable(feature = "from_ref", since = "1.28.0")] +pub fn from_mut<T>(s: &mut T) -> &mut [T] { unsafe { from_raw_parts_mut(s, 1) } diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index f42f876510d..246377b7b57 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -948,7 +948,7 @@ impl<'tcx> TerminatorKind<'tcx> { Drop { target: ref mut t, unwind: Some(ref mut u), .. } | Assert { target: ref mut t, cleanup: Some(ref mut u), .. } | FalseUnwind { real_target: ref mut t, unwind: Some(ref mut u) } => { - Some(t).into_iter().chain(slice::from_ref_mut(u)) + Some(t).into_iter().chain(slice::from_mut(u)) } SwitchInt { ref mut targets, .. } => { None.into_iter().chain(&mut targets[..]) |
