Skip to content

Commit

Permalink
Bump to 1.33.0
Browse files Browse the repository at this point in the history
* Update bootstrap compiler
* Update version to 1.33.0
* Remove some `#[cfg(stage0)]` annotations

Actually updating the version number is blocked on updating Cargo
  • Loading branch information
alexcrichton committed Dec 12, 2018
1 parent bd47d68 commit cf47a19
Show file tree
Hide file tree
Showing 31 changed files with 47 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Build;
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>,
Expand Down
8 changes: 4 additions & 4 deletions src/liballoc/tests/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1514,19 +1514,19 @@ fn contains_weird_cases() {

#[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 ");
assert_eq!(" \t a \t ".trim_end_matches(|c: char| c.is_whitespace()),
" \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()),
"");
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/ffi.rs
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -123,7 +122,6 @@ struct VaListImpl {
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
Expand Down Expand Up @@ -173,7 +171,6 @@ impl<T> sealed_trait::VaArgSafe for *mut T {}
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",
Expand Down Expand Up @@ -208,7 +205,6 @@ impl<'a> VaList<'a> {
}
}

#[cfg(not(stage0))]
extern "rust-intrinsic" {
/// Destroy the arglist `ap` after initialization with `va_start` or
/// `va_copy`.
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,6 @@ extern "rust-intrinsic" {
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.
Expand Down Expand Up @@ -1476,14 +1475,12 @@ extern "rust-intrinsic" {
/// 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.
Expand Down
1 change: 0 additions & 1 deletion src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ pub fn forget<T>(t: T) {
///
/// [`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) }
Expand Down
14 changes: 2 additions & 12 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2330,12 +2330,7 @@ assert_eq!(n.rotate_left(", $rot, "), m);
#[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) }
}
}

Expand All @@ -2360,12 +2355,7 @@ assert_eq!(n.rotate_right(", $rot, "), m);
#[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) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ops/unsize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
/// {}
/// ```
#[unstable(feature = "dispatch_from_dyn", issue = "0")]
#[cfg_attr(not(stage0), lang = "dispatch_from_dyn")]
#[lang = "dispatch_from_dyn"]
pub trait DispatchFromDyn<T> {
// Empty.
}
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,7 @@ atomic_int! {
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"),
Expand All @@ -1954,7 +1954,7 @@ atomic_int! {
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"),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ impl BuiltinLintDiagnostics {
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 {
"::"
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ impl EmitterWriter {

// 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| {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_lint/nonstandard_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl NonSnakeCase {
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
Expand Down Expand Up @@ -199,7 +199,7 @@ impl NonSnakeCase {
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;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ fn main() {
// 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;
};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_mir/borrow_check/move_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,13 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
.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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
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)?
};
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/demand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
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
}
Expand Down Expand Up @@ -519,7 +519,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
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 { "" },
);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn extract_leading_metadata<'a>(s: &'a str) -> (Vec<&'a str>, &'a str) {
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..]);
Expand Down
10 changes: 5 additions & 5 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,23 +294,23 @@ impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for LinkCollector<'a, 'tcx, 'rcx, 'cstor
"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();
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/passes/unindent_comments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn unindent(s: &str) -> String {
});

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()
Expand Down
2 changes: 1 addition & 1 deletion src/libserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3493,7 +3493,7 @@ mod tests {

// 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()
}

Expand Down
1 change: 1 addition & 0 deletions src/libstd/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ impl<T: Error> Error for Box<T> {
Error::description(&**self)
}

#[allow(deprecated)]
fn cause(&self) -> Option<&dyn Error> {
Error::cause(&**self)
}
Expand Down
1 change: 0 additions & 1 deletion src/libstd/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ pub use self::os_str::{OsString, OsStr};
#[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",
Expand Down
1 change: 1 addition & 0 deletions src/libstd/io/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ impl error::Error for Error {
}
}

#[allow(deprecated)]
fn cause(&self) -> Option<&dyn error::Error> {
match self.repr {
Repr::Os(..) => None,
Expand Down
4 changes: 0 additions & 4 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl RefUnwindSafe for atomic::AtomicI32 {}
#[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 {}

Expand All @@ -283,7 +283,7 @@ impl RefUnwindSafe for atomic::AtomicU32 {}
#[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 {}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub fn error_string(mut errnum: i32) -> String {
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
},
Expand Down
1 change: 1 addition & 0 deletions src/libsyntax/diagnostics/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
])
}

#[allow(deprecated)]
pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
span: Span,
token_tree: &[TokenTree])
Expand Down
Loading

0 comments on commit cf47a19

Please sign in to comment.