Bump to 1.33.0
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations
Actually updating the version number is blocked on updating Cargo
diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs
index 88b6925..878b6ed 100644
--- a/src/bootstrap/channel.rs
+++ b/src/bootstrap/channel.rs
@@ -24,7 +24,7 @@
use config::Config;
// The version number
-pub const CFG_RELEASE_NUM: &str = "1.32.0";
+pub const CFG_RELEASE_NUM: &str = "1.33.0";
pub struct GitInfo {
inner: Option<Info>,
diff --git a/src/liballoc/tests/str.rs b/src/liballoc/tests/str.rs
index 683ce2b..9ad8ad1 100644
--- a/src/liballoc/tests/str.rs
+++ b/src/liballoc/tests/str.rs
@@ -1514,9 +1514,9 @@
#[test]
fn trim_ws() {
- assert_eq!(" \t a \t ".trim_left_matches(|c: char| c.is_whitespace()),
+ assert_eq!(" \t a \t ".trim_start_matches(|c: char| c.is_whitespace()),
"a \t ");
- assert_eq!(" \t a \t ".trim_right_matches(|c: char| c.is_whitespace()),
+ assert_eq!(" \t a \t ".trim_end_matches(|c: char| c.is_whitespace()),
" \t a");
assert_eq!(" \t a \t ".trim_start_matches(|c: char| c.is_whitespace()),
"a \t ");
@@ -1524,9 +1524,9 @@
" \t a");
assert_eq!(" \t a \t ".trim_matches(|c: char| c.is_whitespace()),
"a");
- assert_eq!(" \t \t ".trim_left_matches(|c: char| c.is_whitespace()),
+ assert_eq!(" \t \t ".trim_start_matches(|c: char| c.is_whitespace()),
"");
- assert_eq!(" \t \t ".trim_right_matches(|c: char| c.is_whitespace()),
+ assert_eq!(" \t \t ".trim_end_matches(|c: char| c.is_whitespace()),
"");
assert_eq!(" \t \t ".trim_start_matches(|c: char| c.is_whitespace()),
"");
diff --git a/src/libcore/ffi.rs b/src/libcore/ffi.rs
index d7a112e..899fae9 100644
--- a/src/libcore/ffi.rs
+++ b/src/libcore/ffi.rs
@@ -1,7 +1,6 @@
#![stable(feature = "", since = "1.30.0")]
#![allow(non_camel_case_types)]
-#![cfg_attr(stage0, allow(dead_code))]
//! Utilities related to FFI bindings.
@@ -123,7 +122,6 @@
all supported platforms",
issue = "27745")]
#[repr(transparent)]
-#[cfg(not(stage0))]
pub struct VaList<'a>(&'a mut VaListImpl);
// The VaArgSafe trait needs to be used in public interfaces, however, the trait
@@ -173,7 +171,6 @@
issue = "27745")]
impl<T> sealed_trait::VaArgSafe for *const T {}
-#[cfg(not(stage0))]
impl<'a> VaList<'a> {
/// Advance to the next arg.
#[unstable(feature = "c_variadic",
@@ -208,7 +205,6 @@
}
}
-#[cfg(not(stage0))]
extern "rust-intrinsic" {
/// Destroy the arglist `ap` after initialization with `va_start` or
/// `va_copy`.
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index eebb98b..b94d5b4 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -718,7 +718,6 @@
pub fn uninit<T>() -> T;
/// Moves a value out of scope without running drop glue.
- #[cfg(not(stage0))]
pub fn forget<T: ?Sized>(_: T);
/// Reinterprets the bits of a value of one type as another type.
@@ -1476,14 +1475,12 @@
/// The stabilized versions of this intrinsic are available on the integer
/// primitives via the `rotate_left` method. For example,
/// [`std::u32::rotate_left`](../../std/primitive.u32.html#method.rotate_left)
- #[cfg(not(stage0))]
pub fn rotate_left<T>(x: T, y: T) -> T;
/// Performs rotate right.
/// The stabilized versions of this intrinsic are available on the integer
/// primitives via the `rotate_right` method. For example,
/// [`std::u32::rotate_right`](../../std/primitive.u32.html#method.rotate_right)
- #[cfg(not(stage0))]
pub fn rotate_right<T>(x: T, y: T) -> T;
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs
index 06754f1..afd9fcb 100644
--- a/src/libcore/mem.rs
+++ b/src/libcore/mem.rs
@@ -149,7 +149,6 @@
///
/// [`forget`]: fn.forget.html
#[inline]
-#[cfg(not(stage0))]
#[unstable(feature = "forget_unsized", issue = "0")]
pub fn forget_unsized<T: ?Sized>(t: T) {
unsafe { intrinsics::forget(t) }
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 13b4221..4acf3a1 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -2330,12 +2330,7 @@
#[rustc_const_unstable(feature = "const_int_rotate")]
#[inline]
pub const fn rotate_left(self, n: u32) -> Self {
- #[cfg(not(stage0))] {
- unsafe { intrinsics::rotate_left(self, n as $SelfT) }
- }
- #[cfg(stage0)] {
- (self << (n % $BITS)) | (self >> (($BITS - (n % $BITS)) % $BITS))
- }
+ unsafe { intrinsics::rotate_left(self, n as $SelfT) }
}
}
@@ -2360,12 +2355,7 @@
#[rustc_const_unstable(feature = "const_int_rotate")]
#[inline]
pub const fn rotate_right(self, n: u32) -> Self {
- #[cfg(not(stage0))] {
- unsafe { intrinsics::rotate_right(self, n as $SelfT) }
- }
- #[cfg(stage0)] {
- (self >> (n % $BITS)) | (self << (($BITS - (n % $BITS)) % $BITS))
- }
+ unsafe { intrinsics::rotate_right(self, n as $SelfT) }
}
}
diff --git a/src/libcore/ops/unsize.rs b/src/libcore/ops/unsize.rs
index 4d9a40a..e86a392 100644
--- a/src/libcore/ops/unsize.rs
+++ b/src/libcore/ops/unsize.rs
@@ -93,7 +93,7 @@
/// {}
/// ```
#[unstable(feature = "dispatch_from_dyn", issue = "0")]
-#[cfg_attr(not(stage0), lang = "dispatch_from_dyn")]
+#[lang = "dispatch_from_dyn"]
pub trait DispatchFromDyn<T> {
// Empty.
}
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index 27eeb04..060983a 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -1940,7 +1940,7 @@
8,
u64 AtomicU64 ATOMIC_U64_INIT
}
-#[cfg(all(not(stage0), target_has_atomic = "128"))]
+#[cfg(target_has_atomic = "128")]
atomic_int! {
unstable(feature = "integer_atomics", issue = "32976"),
unstable(feature = "integer_atomics", issue = "32976"),
@@ -1954,7 +1954,7 @@
16,
i128 AtomicI128 ATOMIC_I128_INIT
}
-#[cfg(all(not(stage0), target_has_atomic = "128"))]
+#[cfg(target_has_atomic = "128")]
atomic_int! {
unstable(feature = "integer_atomics", issue = "32976"),
unstable(feature = "integer_atomics", issue = "32976"),
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs
index a09d167..b7759a8 100644
--- a/src/librustc/lint/builtin.rs
+++ b/src/librustc/lint/builtin.rs
@@ -463,7 +463,7 @@
Ok(ref s) => {
// FIXME(Manishearth) ideally the emitting code
// can tell us whether or not this is global
- let opt_colon = if s.trim_left().starts_with("::") {
+ let opt_colon = if s.trim_start().starts_with("::") {
""
} else {
"::"
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs
index ae9f6a5..7bd0f0f 100644
--- a/src/librustc_errors/emitter.rs
+++ b/src/librustc_errors/emitter.rs
@@ -1262,7 +1262,7 @@
// Do not underline the leading...
let start = part.snippet.len()
- .saturating_sub(part.snippet.trim_left().len());
+ .saturating_sub(part.snippet.trim_start().len());
// ...or trailing spaces. Account for substitutions containing unicode
// characters.
let sub_len = part.snippet.trim().chars().fold(0, |acc, ch| {
diff --git a/src/librustc_lint/nonstandard_style.rs b/src/librustc_lint/nonstandard_style.rs
index 13be50e..e071c34 100644
--- a/src/librustc_lint/nonstandard_style.rs
+++ b/src/librustc_lint/nonstandard_style.rs
@@ -167,7 +167,7 @@
fn to_snake_case(mut str: &str) -> String {
let mut words = vec![];
// Preserve leading underscores
- str = str.trim_left_matches(|c: char| {
+ str = str.trim_start_matches(|c: char| {
if c == '_' {
words.push(String::new());
true
@@ -199,7 +199,7 @@
if ident.is_empty() {
return true;
}
- let ident = ident.trim_left_matches('\'');
+ let ident = ident.trim_start_matches('\'');
let ident = ident.trim_matches('_');
let mut allow_underscore = true;
diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
index 7d01ed5..ce48208 100644
--- a/src/librustc_llvm/build.rs
+++ b/src/librustc_llvm/build.rs
@@ -192,11 +192,11 @@
// On MSVC llvm-config will print the full name to libraries, but
// we're only interested in the name part
let name = Path::new(lib).file_name().unwrap().to_str().unwrap();
- name.trim_right_matches(".lib")
+ name.trim_end_matches(".lib")
} else if lib.ends_with(".lib") {
// Some MSVC libraries just come up with `.lib` tacked on, so chop
// that off
- lib.trim_right_matches(".lib")
+ lib.trim_end_matches(".lib")
} else {
continue;
};
diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs
index db60017..fb93c41 100644
--- a/src/librustc_mir/borrow_check/move_errors.rs
+++ b/src/librustc_mir/borrow_check/move_errors.rs
@@ -426,13 +426,13 @@
.span_to_snippet(pat_span)
.unwrap();
if pat_snippet.starts_with('&') {
- let pat_snippet = pat_snippet[1..].trim_left();
+ let pat_snippet = pat_snippet[1..].trim_start();
let suggestion;
let to_remove;
if pat_snippet.starts_with("mut")
&& pat_snippet["mut".len()..].starts_with(Pattern_White_Space)
{
- suggestion = pat_snippet["mut".len()..].trim_left();
+ suggestion = pat_snippet["mut".len()..].trim_start();
to_remove = "&mut";
} else {
suggestion = pat_snippet;
diff --git a/src/librustc_mir/interpret/intrinsics.rs b/src/librustc_mir/interpret/intrinsics.rs
index bbee6e0..cbe2e25 100644
--- a/src/librustc_mir/interpret/intrinsics.rs
+++ b/src/librustc_mir/interpret/intrinsics.rs
@@ -103,7 +103,7 @@
if bits == 0 {
return err!(Intrinsic(format!("{} called on 0", intrinsic_name)));
}
- numeric_intrinsic(intrinsic_name.trim_right_matches("_nonzero"), bits, kind)?
+ numeric_intrinsic(intrinsic_name.trim_end_matches("_nonzero"), bits, kind)?
} else {
numeric_intrinsic(intrinsic_name, bits, kind)?
};
diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs
index f4f6b3d..db4b686 100644
--- a/src/librustc_typeck/check/demand.rs
+++ b/src/librustc_typeck/check/demand.rs
@@ -123,7 +123,7 @@
let sole_field_ty = sole_field.ty(self.tcx, substs);
if self.can_coerce(expr_ty, sole_field_ty) {
let variant_path = self.tcx.item_path_str(variant.did);
- Some(variant_path.trim_left_matches("std::prelude::v1::").to_string())
+ Some(variant_path.trim_start_matches("std::prelude::v1::").to_string())
} else {
None
}
@@ -519,7 +519,7 @@
let suffix_suggestion = format!(
"{}{}{}{}",
if needs_paren { "(" } else { "" },
- src.trim_right_matches(&checked_ty.to_string()),
+ src.trim_end_matches(&checked_ty.to_string()),
expected_ty,
if needs_paren { ")" } else { "" },
);
diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs
index e0e0be7..504567e 100644
--- a/src/librustdoc/markdown.rs
+++ b/src/librustdoc/markdown.rs
@@ -35,7 +35,7 @@
for line in s.lines() {
if line.starts_with("# ") || line.starts_with("%") {
// trim the whitespace after the symbol
- metadata.push(line[1..].trim_left());
+ metadata.push(line[1..].trim_start());
count += line.len() + 1;
} else {
return (metadata, &s[count..]);
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index 29062ba..2e8bfd8 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -294,23 +294,23 @@
"trait@", "union@"].iter()
.find(|p| link.starts_with(**p)) {
kind = PathKind::Type;
- link.trim_left_matches(prefix)
+ link.trim_start_matches(prefix)
} else if let Some(prefix) =
["const@", "static@",
"value@", "function@", "mod@",
"fn@", "module@", "method@"]
.iter().find(|p| link.starts_with(**p)) {
kind = PathKind::Value;
- link.trim_left_matches(prefix)
+ link.trim_start_matches(prefix)
} else if link.ends_with("()") {
kind = PathKind::Value;
- link.trim_right_matches("()")
+ link.trim_end_matches("()")
} else if link.starts_with("macro@") {
kind = PathKind::Macro;
- link.trim_left_matches("macro@")
+ link.trim_start_matches("macro@")
} else if link.ends_with('!') {
kind = PathKind::Macro;
- link.trim_right_matches('!')
+ link.trim_end_matches('!')
} else {
&link[..]
}.trim();
diff --git a/src/librustdoc/passes/unindent_comments.rs b/src/librustdoc/passes/unindent_comments.rs
index 6d875c1..5c565bf 100644
--- a/src/librustdoc/passes/unindent_comments.rs
+++ b/src/librustdoc/passes/unindent_comments.rs
@@ -95,7 +95,7 @@
});
if !lines.is_empty() {
- let mut unindented = vec![ lines[0].trim_left().to_string() ];
+ let mut unindented = vec![ lines[0].trim_start().to_string() ];
unindented.extend_from_slice(&lines[1..].iter().map(|&line| {
if line.chars().all(|c| c.is_whitespace()) {
line.to_string()
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index 9439dc7..b0884e1 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -3493,7 +3493,7 @@
// Helper function for counting indents
fn indents(source: &str) -> usize {
- let trimmed = source.trim_left_matches(' ');
+ let trimmed = source.trim_start_matches(' ');
source.len() - trimmed.len()
}
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index a9b2711..e5c5ab8 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -533,6 +533,7 @@
Error::description(&**self)
}
+ #[allow(deprecated)]
fn cause(&self) -> Option<&dyn Error> {
Error::cause(&**self)
}
diff --git a/src/libstd/ffi/mod.rs b/src/libstd/ffi/mod.rs
index 99da73a..f46c4f2 100644
--- a/src/libstd/ffi/mod.rs
+++ b/src/libstd/ffi/mod.rs
@@ -174,7 +174,6 @@
#[stable(feature = "raw_os", since = "1.1.0")]
pub use core::ffi::c_void;
-#[cfg(not(stage0))]
#[unstable(feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs
index 32e2996..d3844eb 100644
--- a/src/libstd/io/error.rs
+++ b/src/libstd/io/error.rs
@@ -555,6 +555,7 @@
}
}
+ #[allow(deprecated)]
fn cause(&self) -> Option<&dyn error::Error> {
match self.repr {
Repr::Os(..) => None,
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 90c8eaf..7c43ba5 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -317,10 +317,6 @@
#![default_lib_allocator]
-#[cfg(stage0)]
-#[global_allocator]
-static ALLOC: alloc::System = alloc::System;
-
// Explicitly import the prelude. The compiler uses this same unstable attribute
// to import the prelude implicitly when building crates that depend on std.
#[prelude_import]
diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs
index 099b4d6..3eacc7a 100644
--- a/src/libstd/panic.rs
+++ b/src/libstd/panic.rs
@@ -264,7 +264,7 @@
#[cfg(target_has_atomic = "64")]
#[unstable(feature = "integer_atomics", issue = "32976")]
impl RefUnwindSafe for atomic::AtomicI64 {}
-#[cfg(all(not(stage0), target_has_atomic = "128"))]
+#[cfg(target_has_atomic = "128")]
#[unstable(feature = "integer_atomics", issue = "32976")]
impl RefUnwindSafe for atomic::AtomicI128 {}
@@ -283,7 +283,7 @@
#[cfg(target_has_atomic = "64")]
#[unstable(feature = "integer_atomics", issue = "32976")]
impl RefUnwindSafe for atomic::AtomicU64 {}
-#[cfg(all(not(stage0), target_has_atomic = "128"))]
+#[cfg(target_has_atomic = "128")]
#[unstable(feature = "integer_atomics", issue = "32976")]
impl RefUnwindSafe for atomic::AtomicU128 {}
diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs
index 2be30e6..84ef62e 100644
--- a/src/libstd/sys/windows/os.rs
+++ b/src/libstd/sys/windows/os.rs
@@ -76,7 +76,7 @@
match String::from_utf16(&buf[..res]) {
Ok(mut msg) => {
// Trim trailing CRLF inserted by FormatMessageW
- let len = msg.trim_right().len();
+ let len = msg.trim_end().len();
msg.truncate(len);
msg
},
diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs
index 1229db9..3b88767 100644
--- a/src/libsyntax/diagnostics/plugin.rs
+++ b/src/libsyntax/diagnostics/plugin.rs
@@ -141,6 +141,7 @@
])
}
+#[allow(deprecated)]
pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
span: Span,
token_tree: &[TokenTree])
diff --git a/src/libsyntax/source_map.rs b/src/libsyntax/source_map.rs
index 4500812..9a34312 100644
--- a/src/libsyntax/source_map.rs
+++ b/src/libsyntax/source_map.rs
@@ -579,7 +579,7 @@
match self.span_to_prev_source(sp) {
Err(_) => None,
Ok(source) => source.split('\n').last().map(|last_line| {
- last_line.len() - last_line.trim_left().len()
+ last_line.len() - last_line.trim_start().len()
})
}
}
@@ -593,7 +593,7 @@
/// if no character could be found or if an error occurred while retrieving the code snippet.
pub fn span_extend_to_prev_char(&self, sp: Span, c: char) -> Span {
if let Ok(prev_source) = self.span_to_prev_source(sp) {
- let prev_source = prev_source.rsplit(c).nth(0).unwrap_or("").trim_left();
+ let prev_source = prev_source.rsplit(c).nth(0).unwrap_or("").trim_start();
if !prev_source.is_empty() && !prev_source.contains('\n') {
return sp.with_lo(BytePos(sp.lo().0 - prev_source.len() as u32));
}
@@ -613,7 +613,7 @@
for ws in &[" ", "\t", "\n"] {
let pat = pat.to_owned() + ws;
if let Ok(prev_source) = self.span_to_prev_source(sp) {
- let prev_source = prev_source.rsplit(&pat).nth(0).unwrap_or("").trim_left();
+ let prev_source = prev_source.rsplit(&pat).nth(0).unwrap_or("").trim_start();
if !prev_source.is_empty() && (!prev_source.contains('\n') || accept_newlines) {
return sp.with_lo(BytePos(sp.lo().0 - prev_source.len() as u32));
}
@@ -627,7 +627,7 @@
pub fn span_until_char(&self, sp: Span, c: char) -> Span {
match self.span_to_snippet(sp) {
Ok(snippet) => {
- let snippet = snippet.split(c).nth(0).unwrap_or("").trim_right();
+ let snippet = snippet.split(c).nth(0).unwrap_or("").trim_end();
if !snippet.is_empty() && !snippet.contains('\n') {
sp.with_hi(BytePos(sp.lo().0 + snippet.len() as u32))
} else {
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs
index 05c5387..f1adb9d 100644
--- a/src/libsyntax_pos/symbol.rs
+++ b/src/libsyntax_pos/symbol.rs
@@ -57,7 +57,7 @@
}
pub fn without_first_quote(self) -> Ident {
- Ident::new(Symbol::intern(self.as_str().trim_left_matches('\'')), self.span)
+ Ident::new(Symbol::intern(self.as_str().trim_start_matches('\'')), self.span)
}
/// "Normalize" ident for use in comparisons using "item hygiene".
diff --git a/src/stage0.txt b/src/stage0.txt
index 8369413..843ecae 100644
--- a/src/stage0.txt
+++ b/src/stage0.txt
@@ -12,7 +12,7 @@
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
# `0.x.0` for Cargo where they were released on `date`.
-date: 2018-11-21
+date: 2018-12-09
rustc: beta
cargo: beta
diff --git a/src/tools/cargo b/src/tools/cargo
index 28fb200..2cf1f5d 160000
--- a/src/tools/cargo
+++ b/src/tools/cargo
@@ -1 +1 @@
-Subproject commit 28fb20034a5bb42ea589664de2617dd1840506d3
+Subproject commit 2cf1f5dda2f7ed84e94c4d32f643e0f1f15352f0
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index 65f6bff..9aefd15 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -511,7 +511,11 @@
test::TestOpts {
filter: config.filter.clone(),
filter_exact: config.filter_exact,
- run_ignored: config.run_ignored,
+ run_ignored: if config.run_ignored {
+ test::RunIgnored::Yes
+ } else {
+ test::RunIgnored::No
+ },
format: if config.quiet {
test::OutputFormat::Terse
} else {