Skip to content

Commit ddaab61

Browse files
committed
Auto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturon
Stabilize more APIs for the 1.20.0 release In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
2 parents 599be0d + 16707d4 commit ddaab61

File tree

23 files changed

+47
-128
lines changed

23 files changed

+47
-128
lines changed

src/doc/unstable-book/src/language-features/compile-error.md

-20
This file was deleted.

src/liballoc/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,9 @@
7979

8080
#![cfg_attr(test, allow(deprecated))] // rand
8181
#![cfg_attr(test, feature(placement_in))]
82-
#![cfg_attr(not(test), feature(char_escape_debug))]
8382
#![cfg_attr(not(test), feature(core_float))]
8483
#![cfg_attr(not(test), feature(exact_size_is_empty))]
8584
#![cfg_attr(not(test), feature(slice_rotate))]
86-
#![cfg_attr(not(test), feature(str_checked_slicing))]
8785
#![cfg_attr(test, feature(rand, test))]
8886
#![feature(allow_internal_unstable)]
8987
#![feature(box_patterns)]
@@ -102,7 +100,6 @@
102100
#![feature(i128_type)]
103101
#![feature(inclusive_range)]
104102
#![feature(lang_items)]
105-
#![feature(manually_drop)]
106103
#![feature(needs_allocator)]
107104
#![feature(nonzero)]
108105
#![feature(offset_to)]
@@ -117,7 +114,6 @@
117114
#![feature(specialization)]
118115
#![feature(staged_api)]
119116
#![feature(str_internals)]
120-
#![feature(str_mut_extras)]
121117
#![feature(trusted_len)]
122118
#![feature(unboxed_closures)]
123119
#![feature(unicode)]

src/liballoc/str.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl str {
290290
}
291291

292292
/// Converts a mutable string slice to a mutable byte slice.
293-
#[unstable(feature = "str_mut_extras", issue = "41119")]
293+
#[stable(feature = "str_mut_extras", since = "1.20.0")]
294294
#[inline(always)]
295295
pub unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
296296
core_str::StrExt::as_bytes_mut(self)
@@ -328,14 +328,13 @@ impl str {
328328
/// # Examples
329329
///
330330
/// ```
331-
/// # #![feature(str_checked_slicing)]
332331
/// let v = "🗻∈🌏";
333332
/// assert_eq!(Some("🗻"), v.get(0..4));
334333
/// assert!(v.get(1..).is_none());
335334
/// assert!(v.get(..8).is_none());
336335
/// assert!(v.get(..42).is_none());
337336
/// ```
338-
#[unstable(feature = "str_checked_slicing", issue = "39932")]
337+
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
339338
#[inline]
340339
pub fn get<I: SliceIndex<str>>(&self, i: I) -> Option<&I::Output> {
341340
core_str::StrExt::get(self, i)
@@ -351,14 +350,13 @@ impl str {
351350
/// # Examples
352351
///
353352
/// ```
354-
/// # #![feature(str_checked_slicing)]
355353
/// let mut v = String::from("🗻∈🌏");
356354
/// assert_eq!(Some("🗻"), v.get_mut(0..4).map(|v| &*v));
357355
/// assert!(v.get_mut(1..).is_none());
358356
/// assert!(v.get_mut(..8).is_none());
359357
/// assert!(v.get_mut(..42).is_none());
360358
/// ```
361-
#[unstable(feature = "str_checked_slicing", issue = "39932")]
359+
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
362360
#[inline]
363361
pub fn get_mut<I: SliceIndex<str>>(&mut self, i: I) -> Option<&mut I::Output> {
364362
core_str::StrExt::get_mut(self, i)
@@ -383,15 +381,14 @@ impl str {
383381
/// # Examples
384382
///
385383
/// ```
386-
/// # #![feature(str_checked_slicing)]
387384
/// let v = "🗻∈🌏";
388385
/// unsafe {
389386
/// assert_eq!("🗻", v.get_unchecked(0..4));
390387
/// assert_eq!("∈", v.get_unchecked(4..7));
391388
/// assert_eq!("🌏", v.get_unchecked(7..11));
392389
/// }
393390
/// ```
394-
#[unstable(feature = "str_checked_slicing", issue = "39932")]
391+
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
395392
#[inline]
396393
pub unsafe fn get_unchecked<I: SliceIndex<str>>(&self, i: I) -> &I::Output {
397394
core_str::StrExt::get_unchecked(self, i)
@@ -416,15 +413,14 @@ impl str {
416413
/// # Examples
417414
///
418415
/// ```
419-
/// # #![feature(str_checked_slicing)]
420416
/// let mut v = String::from("🗻∈🌏");
421417
/// unsafe {
422418
/// assert_eq!("🗻", v.get_unchecked_mut(0..4));
423419
/// assert_eq!("∈", v.get_unchecked_mut(4..7));
424420
/// assert_eq!("🌏", v.get_unchecked_mut(7..11));
425421
/// }
426422
/// ```
427-
#[unstable(feature = "str_checked_slicing", issue = "39932")]
423+
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
428424
#[inline]
429425
pub unsafe fn get_unchecked_mut<I: SliceIndex<str>>(&mut self, i: I) -> &mut I::Output {
430426
core_str::StrExt::get_unchecked_mut(self, i)
@@ -1729,7 +1725,7 @@ impl str {
17291725
}
17301726

17311727
/// Converts a `Box<str>` into a `Box<[u8]>` without copying or allocating.
1732-
#[unstable(feature = "str_box_extras", issue = "41119")]
1728+
#[stable(feature = "str_box_extras", since = "1.20.0")]
17331729
pub fn into_boxed_bytes(self: Box<str>) -> Box<[u8]> {
17341730
self.into()
17351731
}
@@ -1996,7 +1992,7 @@ impl str {
19961992

19971993
/// Converts a boxed slice of bytes to a boxed string slice without checking
19981994
/// that the string contains valid UTF-8.
1999-
#[unstable(feature = "str_box_extras", issue = "41119")]
1995+
#[stable(feature = "str_box_extras", since = "1.20.0")]
20001996
pub unsafe fn from_boxed_utf8_unchecked(v: Box<[u8]>) -> Box<str> {
20011997
mem::transmute(v)
20021998
}

src/liballoc/tests/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
#![feature(repr_align)]
2525
#![feature(slice_rotate)]
2626
#![feature(splice)]
27-
#![feature(str_checked_slicing)]
2827
#![feature(str_escape)]
2928
#![feature(test)]
3029
#![feature(unboxed_closures)]
3130
#![feature(unicode)]
32-
#![feature(utf8_error_error_len)]
3331

3432
extern crate alloc;
3533
extern crate test;

src/libcore/char.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ pub trait CharExt {
379379
fn escape_unicode(self) -> EscapeUnicode;
380380
#[stable(feature = "core", since = "1.6.0")]
381381
fn escape_default(self) -> EscapeDefault;
382-
#[unstable(feature = "char_escape_debug", issue = "35068")]
382+
#[stable(feature = "char_escape_debug", since = "1.20.0")]
383383
fn escape_debug(self) -> EscapeDebug;
384384
#[stable(feature = "core", since = "1.6.0")]
385385
fn len_utf8(self) -> usize;
@@ -776,24 +776,24 @@ impl fmt::Display for EscapeDefault {
776776
///
777777
/// [`escape_debug`]: ../../std/primitive.char.html#method.escape_debug
778778
/// [`char`]: ../../std/primitive.char.html
779-
#[unstable(feature = "char_escape_debug", issue = "35068")]
779+
#[stable(feature = "char_escape_debug", since = "1.20.0")]
780780
#[derive(Clone, Debug)]
781781
pub struct EscapeDebug(EscapeDefault);
782782

783-
#[unstable(feature = "char_escape_debug", issue = "35068")]
783+
#[stable(feature = "char_escape_debug", since = "1.20.0")]
784784
impl Iterator for EscapeDebug {
785785
type Item = char;
786786
fn next(&mut self) -> Option<char> { self.0.next() }
787787
fn size_hint(&self) -> (usize, Option<usize>) { self.0.size_hint() }
788788
}
789789

790-
#[unstable(feature = "char_escape_debug", issue = "35068")]
790+
#[stable(feature = "char_escape_debug", since = "1.20.0")]
791791
impl ExactSizeIterator for EscapeDebug { }
792792

793793
#[unstable(feature = "fused", issue = "35602")]
794794
impl FusedIterator for EscapeDebug {}
795795

796-
#[unstable(feature = "char_escape_debug", issue = "35068")]
796+
#[stable(feature = "char_escape_debug", since = "1.20.0")]
797797
impl fmt::Display for EscapeDebug {
798798
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
799799
fmt::Display::fmt(&self.0, f)

src/libcore/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ mod builtin {
574574
/// For more information, see the [RFC].
575575
///
576576
/// [RFC]: https://github.com/rust-lang/rfcs/blob/master/text/1695-add-error-macro.md
577-
#[unstable(feature = "compile_error_macro", issue = "40872")]
577+
#[stable(feature = "compile_error_macro", since = "1.20.0")]
578578
#[macro_export]
579579
#[cfg(dox)]
580580
macro_rules! compile_error { ($msg:expr) => ({ /* compiler built-in */ }) }

src/libcore/mem.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,6 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
838838
/// the type:
839839
///
840840
/// ```rust
841-
/// # #![feature(manually_drop)]
842841
/// use std::mem::ManuallyDrop;
843842
/// struct Peach;
844843
/// struct Banana;
@@ -864,7 +863,7 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
864863
/// }
865864
/// }
866865
/// ```
867-
#[unstable(feature = "manually_drop", issue = "40673")]
866+
#[stable(feature = "manually_drop", since = "1.20.0")]
868867
#[allow(unions_with_drop_fields)]
869868
pub union ManuallyDrop<T>{ value: T }
870869

@@ -874,11 +873,10 @@ impl<T> ManuallyDrop<T> {
874873
/// # Examples
875874
///
876875
/// ```rust
877-
/// # #![feature(manually_drop)]
878876
/// use std::mem::ManuallyDrop;
879877
/// ManuallyDrop::new(Box::new(()));
880878
/// ```
881-
#[unstable(feature = "manually_drop", issue = "40673")]
879+
#[stable(feature = "manually_drop", since = "1.20.0")]
882880
#[inline]
883881
pub fn new(value: T) -> ManuallyDrop<T> {
884882
ManuallyDrop { value: value }
@@ -889,12 +887,11 @@ impl<T> ManuallyDrop<T> {
889887
/// # Examples
890888
///
891889
/// ```rust
892-
/// # #![feature(manually_drop)]
893890
/// use std::mem::ManuallyDrop;
894891
/// let x = ManuallyDrop::new(Box::new(()));
895892
/// let _: Box<()> = ManuallyDrop::into_inner(x);
896893
/// ```
897-
#[unstable(feature = "manually_drop", issue = "40673")]
894+
#[stable(feature = "manually_drop", since = "1.20.0")]
898895
#[inline]
899896
pub fn into_inner(slot: ManuallyDrop<T>) -> T {
900897
unsafe {
@@ -909,14 +906,14 @@ impl<T> ManuallyDrop<T> {
909906
/// This function runs the destructor of the contained value and thus the wrapped value
910907
/// now represents uninitialized data. It is up to the user of this method to ensure the
911908
/// uninitialized data is not actually used.
912-
#[unstable(feature = "manually_drop", issue = "40673")]
909+
#[stable(feature = "manually_drop", since = "1.20.0")]
913910
#[inline]
914911
pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
915912
ptr::drop_in_place(&mut slot.value)
916913
}
917914
}
918915

919-
#[unstable(feature = "manually_drop", issue = "40673")]
916+
#[stable(feature = "manually_drop", since = "1.20.0")]
920917
impl<T> ::ops::Deref for ManuallyDrop<T> {
921918
type Target = T;
922919
#[inline]
@@ -927,7 +924,7 @@ impl<T> ::ops::Deref for ManuallyDrop<T> {
927924
}
928925
}
929926

930-
#[unstable(feature = "manually_drop", issue = "40673")]
927+
#[stable(feature = "manually_drop", since = "1.20.0")]
931928
impl<T> ::ops::DerefMut for ManuallyDrop<T> {
932929
#[inline]
933930
fn deref_mut(&mut self) -> &mut Self::Target {
@@ -937,7 +934,7 @@ impl<T> ::ops::DerefMut for ManuallyDrop<T> {
937934
}
938935
}
939936

940-
#[unstable(feature = "manually_drop", issue = "40673")]
937+
#[stable(feature = "manually_drop", since = "1.20.0")]
941938
impl<T: ::fmt::Debug> ::fmt::Debug for ManuallyDrop<T> {
942939
fn fmt(&self, fmt: &mut ::fmt::Formatter) -> ::fmt::Result {
943940
unsafe {

src/libcore/option.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,6 @@ impl<T> Option<T> {
671671
/// # Examples
672672
///
673673
/// ```
674-
/// #![feature(option_entry)]
675-
///
676674
/// let mut x = None;
677675
///
678676
/// {
@@ -685,7 +683,7 @@ impl<T> Option<T> {
685683
/// assert_eq!(x, Some(7));
686684
/// ```
687685
#[inline]
688-
#[unstable(feature = "option_entry", issue = "39288")]
686+
#[stable(feature = "option_entry", since = "1.20.0")]
689687
pub fn get_or_insert(&mut self, v: T) -> &mut T {
690688
match *self {
691689
None => *self = Some(v),
@@ -706,8 +704,6 @@ impl<T> Option<T> {
706704
/// # Examples
707705
///
708706
/// ```
709-
/// #![feature(option_entry)]
710-
///
711707
/// let mut x = None;
712708
///
713709
/// {
@@ -720,7 +716,7 @@ impl<T> Option<T> {
720716
/// assert_eq!(x, Some(7));
721717
/// ```
722718
#[inline]
723-
#[unstable(feature = "option_entry", issue = "39288")]
719+
#[stable(feature = "option_entry", since = "1.20.0")]
724720
pub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T {
725721
match *self {
726722
None => *self = Some(f()),

0 commit comments

Comments
 (0)