Skip to content

Commit 26d62f5

Browse files
author
Stjepan Glavina
committed
Stabilize feature from_ref
1 parent 6e6a4b1 commit 26d62f5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/liballoc/slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ pub use core::slice::{SplitN, RSplitN, SplitNMut, RSplitNMut};
119119
pub use core::slice::{RSplit, RSplitMut};
120120
#[stable(feature = "rust1", since = "1.0.0")]
121121
pub use core::slice::{from_raw_parts, from_raw_parts_mut};
122-
#[unstable(feature = "from_ref", issue = "45703")]
123-
pub use core::slice::{from_ref, from_ref_mut};
122+
#[stable(feature = "from_ref", since = "1.28.0")]
123+
pub use core::slice::{from_ref, from_mut};
124124
#[unstable(feature = "slice_get_slice", issue = "35729")]
125125
pub use core::slice::SliceIndex;
126126
#[unstable(feature = "exact_chunks", issue = "47115")]

src/libcore/slice/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3874,16 +3874,16 @@ pub unsafe fn from_raw_parts_mut<'a, T>(p: *mut T, len: usize) -> &'a mut [T] {
38743874
}
38753875

38763876
/// Converts a reference to T into a slice of length 1 (without copying).
3877-
#[unstable(feature = "from_ref", issue = "45703")]
3877+
#[stable(feature = "from_ref", since = "1.28.0")]
38783878
pub fn from_ref<T>(s: &T) -> &[T] {
38793879
unsafe {
38803880
from_raw_parts(s, 1)
38813881
}
38823882
}
38833883

38843884
/// Converts a reference to T into a slice of length 1 (without copying).
3885-
#[unstable(feature = "from_ref", issue = "45703")]
3886-
pub fn from_ref_mut<T>(s: &mut T) -> &mut [T] {
3885+
#[stable(feature = "from_ref", since = "1.28.0")]
3886+
pub fn from_mut<T>(s: &mut T) -> &mut [T] {
38873887
unsafe {
38883888
from_raw_parts_mut(s, 1)
38893889
}

src/librustc/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ impl<'tcx> TerminatorKind<'tcx> {
948948
Drop { target: ref mut t, unwind: Some(ref mut u), .. } |
949949
Assert { target: ref mut t, cleanup: Some(ref mut u), .. } |
950950
FalseUnwind { real_target: ref mut t, unwind: Some(ref mut u) } => {
951-
Some(t).into_iter().chain(slice::from_ref_mut(u))
951+
Some(t).into_iter().chain(slice::from_mut(u))
952952
}
953953
SwitchInt { ref mut targets, .. } => {
954954
None.into_iter().chain(&mut targets[..])

0 commit comments

Comments
 (0)