Skip to content

Commit 54279df

Browse files
committed
Auto merge of #43831 - alexcrichton:beta-next, r=alexcrichton
Backporting accepted PRs to beta Backport of: * #43735 * #43546 * #43513 * #43373 * #43315
2 parents 6807eef + 5f554ed commit 54279df

File tree

35 files changed

+235
-135
lines changed

35 files changed

+235
-135
lines changed

src/Cargo.lock

+11-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub const CFG_RELEASE_NUM: &str = "1.20.0";
2828
// An optional number to put after the label, e.g. '.2' -> '-beta.2'
2929
// Be sure to make this starts with a dot to conform to semver pre-release
3030
// versions (section 9)
31-
pub const CFG_PRERELEASE_VERSION: &str = ".1";
31+
pub const CFG_PRERELEASE_VERSION: &str = ".2";
3232

3333
pub struct GitInfo {
3434
inner: Option<Info>,

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

-20
This file was deleted.

src/liballoc/allocator.rs

+1
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ impl Layout {
207207
/// of each element in the array.
208208
///
209209
/// On arithmetic overflow, returns `None`.
210+
#[inline]
210211
pub fn repeat(&self, n: usize) -> Option<(Self, usize)> {
211212
let padded_size = match self.size.checked_add(self.padding_needed_for(self.align)) {
212213
None => return None,

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
#![cfg_attr(stage0, feature(allocator))]
8987
#![feature(allow_internal_unstable)]
@@ -103,7 +101,6 @@
103101
#![feature(i128_type)]
104102
#![feature(inclusive_range)]
105103
#![feature(lang_items)]
106-
#![feature(manually_drop)]
107104
#![feature(needs_allocator)]
108105
#![feature(nonzero)]
109106
#![feature(offset_to)]
@@ -118,7 +115,6 @@
118115
#![feature(specialization)]
119116
#![feature(staged_api)]
120117
#![feature(str_internals)]
121-
#![feature(str_mut_extras)]
122118
#![feature(trusted_len)]
123119
#![feature(unboxed_closures)]
124120
#![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

+13-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[macro_export]
12+
// This stability attribute is totally useless.
13+
#[stable(feature = "rust1", since = "1.0.0")]
14+
#[cfg(stage0)]
15+
macro_rules! __rust_unstable_column {
16+
() => {
17+
column!()
18+
}
19+
}
20+
1121
/// Entry point of thread panic, for details, see std::macros
1222
#[macro_export]
1323
#[allow_internal_unstable]
@@ -18,7 +28,7 @@ macro_rules! panic {
1828
);
1929
($msg:expr) => ({
2030
static _MSG_FILE_LINE_COL: (&'static str, &'static str, u32, u32) =
21-
($msg, file!(), line!(), column!());
31+
($msg, file!(), line!(), __rust_unstable_column!());
2232
$crate::panicking::panic(&_MSG_FILE_LINE_COL)
2333
});
2434
($fmt:expr, $($arg:tt)*) => ({
@@ -27,7 +37,7 @@ macro_rules! panic {
2737
// insufficient, since the user may have
2838
// `#[forbid(dead_code)]` and which cannot be overridden.
2939
static _MSG_FILE_LINE_COL: (&'static str, u32, u32) =
30-
(file!(), line!(), column!());
40+
(file!(), line!(), __rust_unstable_column!());
3141
$crate::panicking::panic_fmt(format_args!($fmt, $($arg)*), &_MSG_FILE_LINE_COL)
3242
});
3343
}
@@ -574,7 +584,7 @@ mod builtin {
574584
/// For more information, see the [RFC].
575585
///
576586
/// [RFC]: https://github.com/rust-lang/rfcs/blob/master/text/1695-add-error-macro.md
577-
#[unstable(feature = "compile_error_macro", issue = "40872")]
587+
#[stable(feature = "compile_error_macro", since = "1.20.0")]
578588
#[macro_export]
579589
#[cfg(dox)]
580590
macro_rules! compile_error { ($msg:expr) => ({ /* compiler built-in */ }) }

src/libcore/mem.rs

+7-10
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
795795
/// the type:
796796
///
797797
/// ```rust
798-
/// # #![feature(manually_drop)]
799798
/// use std::mem::ManuallyDrop;
800799
/// struct Peach;
801800
/// struct Banana;
@@ -821,7 +820,7 @@ pub fn discriminant<T>(v: &T) -> Discriminant<T> {
821820
/// }
822821
/// }
823822
/// ```
824-
#[unstable(feature = "manually_drop", issue = "40673")]
823+
#[stable(feature = "manually_drop", since = "1.20.0")]
825824
#[allow(unions_with_drop_fields)]
826825
pub union ManuallyDrop<T>{ value: T }
827826

@@ -831,11 +830,10 @@ impl<T> ManuallyDrop<T> {
831830
/// # Examples
832831
///
833832
/// ```rust
834-
/// # #![feature(manually_drop)]
835833
/// use std::mem::ManuallyDrop;
836834
/// ManuallyDrop::new(Box::new(()));
837835
/// ```
838-
#[unstable(feature = "manually_drop", issue = "40673")]
836+
#[stable(feature = "manually_drop", since = "1.20.0")]
839837
#[inline]
840838
pub fn new(value: T) -> ManuallyDrop<T> {
841839
ManuallyDrop { value: value }
@@ -846,12 +844,11 @@ impl<T> ManuallyDrop<T> {
846844
/// # Examples
847845
///
848846
/// ```rust
849-
/// # #![feature(manually_drop)]
850847
/// use std::mem::ManuallyDrop;
851848
/// let x = ManuallyDrop::new(Box::new(()));
852849
/// let _: Box<()> = ManuallyDrop::into_inner(x);
853850
/// ```
854-
#[unstable(feature = "manually_drop", issue = "40673")]
851+
#[stable(feature = "manually_drop", since = "1.20.0")]
855852
#[inline]
856853
pub fn into_inner(slot: ManuallyDrop<T>) -> T {
857854
unsafe {
@@ -866,14 +863,14 @@ impl<T> ManuallyDrop<T> {
866863
/// This function runs the destructor of the contained value and thus the wrapped value
867864
/// now represents uninitialized data. It is up to the user of this method to ensure the
868865
/// uninitialized data is not actually used.
869-
#[unstable(feature = "manually_drop", issue = "40673")]
866+
#[stable(feature = "manually_drop", since = "1.20.0")]
870867
#[inline]
871868
pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
872869
ptr::drop_in_place(&mut slot.value)
873870
}
874871
}
875872

876-
#[unstable(feature = "manually_drop", issue = "40673")]
873+
#[stable(feature = "manually_drop", since = "1.20.0")]
877874
impl<T> ::ops::Deref for ManuallyDrop<T> {
878875
type Target = T;
879876
#[inline]
@@ -884,7 +881,7 @@ impl<T> ::ops::Deref for ManuallyDrop<T> {
884881
}
885882
}
886883

887-
#[unstable(feature = "manually_drop", issue = "40673")]
884+
#[stable(feature = "manually_drop", since = "1.20.0")]
888885
impl<T> ::ops::DerefMut for ManuallyDrop<T> {
889886
#[inline]
890887
fn deref_mut(&mut self) -> &mut Self::Target {
@@ -894,7 +891,7 @@ impl<T> ::ops::DerefMut for ManuallyDrop<T> {
894891
}
895892
}
896893

897-
#[unstable(feature = "manually_drop", issue = "40673")]
894+
#[stable(feature = "manually_drop", since = "1.20.0")]
898895
impl<T: ::fmt::Debug> ::fmt::Debug for ManuallyDrop<T> {
899896
fn fmt(&self, fmt: &mut ::fmt::Formatter) -> ::fmt::Result {
900897
unsafe {

0 commit comments

Comments
 (0)