Skip to content

Commit 98e801a

Browse files
authored
Rollup merge of rust-lang#50945 - stjepang:stabilize-from-ref, r=SimonSapin
Stabilize feature from_ref Function `from_ref_mut` is now renamed to `from_mut`, as discussed in rust-lang#45703. Closes rust-lang#45703. r? @SimonSapin
2 parents 5b67b13 + 26d62f5 commit 98e801a

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
@@ -3884,16 +3884,16 @@ pub unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a mut [T]
38843884
}
38853885

38863886
/// Converts a reference to T into a slice of length 1 (without copying).
3887-
#[unstable(feature = "from_ref", issue = "45703")]
3887+
#[stable(feature = "from_ref", since = "1.28.0")]
38883888
pub fn from_ref<T>(s: &T) -> &[T] {
38893889
unsafe {
38903890
from_raw_parts(s, 1)
38913891
}
38923892
}
38933893

38943894
/// Converts a reference to T into a slice of length 1 (without copying).
3895-
#[unstable(feature = "from_ref", issue = "45703")]
3896-
pub fn from_ref_mut<T>(s: &mut T) -> &mut [T] {
3895+
#[stable(feature = "from_ref", since = "1.28.0")]
3896+
pub fn from_mut<T>(s: &mut T) -> &mut [T] {
38973897
unsafe {
38983898
from_raw_parts_mut(s, 1)
38993899
}

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)