Skip to content

Commit 964d2bb

Browse files
committed
Auto merge of #56536 - alexcrichton:update-master, r=Mark-Simulacrum
Bump to 1.33.0 * Update bootstrap compiler * Update version to 1.33.0 * Remove some `#[cfg(stage0)]` annotations
2 parents f504d3f + a8f385f commit 964d2bb

File tree

29 files changed

+45
-61
lines changed

29 files changed

+45
-61
lines changed

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use Build;
2424
use config::Config;
2525

2626
// The version number
27-
pub const CFG_RELEASE_NUM: &str = "1.32.0";
27+
pub const CFG_RELEASE_NUM: &str = "1.33.0";
2828

2929
pub struct GitInfo {
3030
inner: Option<Info>,

src/liballoc/tests/str.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1514,19 +1514,19 @@ fn contains_weird_cases() {
15141514

15151515
#[test]
15161516
fn trim_ws() {
1517-
assert_eq!(" \t a \t ".trim_left_matches(|c: char| c.is_whitespace()),
1517+
assert_eq!(" \t a \t ".trim_start_matches(|c: char| c.is_whitespace()),
15181518
"a \t ");
1519-
assert_eq!(" \t a \t ".trim_right_matches(|c: char| c.is_whitespace()),
1519+
assert_eq!(" \t a \t ".trim_end_matches(|c: char| c.is_whitespace()),
15201520
" \t a");
15211521
assert_eq!(" \t a \t ".trim_start_matches(|c: char| c.is_whitespace()),
15221522
"a \t ");
15231523
assert_eq!(" \t a \t ".trim_end_matches(|c: char| c.is_whitespace()),
15241524
" \t a");
15251525
assert_eq!(" \t a \t ".trim_matches(|c: char| c.is_whitespace()),
15261526
"a");
1527-
assert_eq!(" \t \t ".trim_left_matches(|c: char| c.is_whitespace()),
1527+
assert_eq!(" \t \t ".trim_start_matches(|c: char| c.is_whitespace()),
15281528
"");
1529-
assert_eq!(" \t \t ".trim_right_matches(|c: char| c.is_whitespace()),
1529+
assert_eq!(" \t \t ".trim_end_matches(|c: char| c.is_whitespace()),
15301530
"");
15311531
assert_eq!(" \t \t ".trim_start_matches(|c: char| c.is_whitespace()),
15321532
"");

src/libcore/ffi.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![stable(feature = "", since = "1.30.0")]
22

33
#![allow(non_camel_case_types)]
4-
#![cfg_attr(stage0, allow(dead_code))]
54

65
//! Utilities related to FFI bindings.
76
@@ -122,7 +121,6 @@ struct VaListImpl {
122121
all supported platforms",
123122
issue = "27745")]
124123
#[repr(transparent)]
125-
#[cfg(not(stage0))]
126124
pub struct VaList<'a>(&'a mut VaListImpl);
127125

128126
// The VaArgSafe trait needs to be used in public interfaces, however, the trait
@@ -172,7 +170,6 @@ impl<T> sealed_trait::VaArgSafe for *mut T {}
172170
issue = "27745")]
173171
impl<T> sealed_trait::VaArgSafe for *const T {}
174172

175-
#[cfg(not(stage0))]
176173
impl<'a> VaList<'a> {
177174
/// Advance to the next arg.
178175
#[unstable(feature = "c_variadic",
@@ -206,7 +203,6 @@ impl<'a> VaList<'a> {
206203
}
207204
}
208205

209-
#[cfg(not(stage0))]
210206
extern "rust-intrinsic" {
211207
/// Destroy the arglist `ap` after initialization with `va_start` or
212208
/// `va_copy`.

src/libcore/intrinsics.rs

-3
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ extern "rust-intrinsic" {
718718
pub fn uninit<T>() -> T;
719719

720720
/// Moves a value out of scope without running drop glue.
721-
#[cfg(not(stage0))]
722721
pub fn forget<T: ?Sized>(_: T);
723722

724723
/// Reinterprets the bits of a value of one type as another type.
@@ -1476,14 +1475,12 @@ extern "rust-intrinsic" {
14761475
/// The stabilized versions of this intrinsic are available on the integer
14771476
/// primitives via the `rotate_left` method. For example,
14781477
/// [`std::u32::rotate_left`](../../std/primitive.u32.html#method.rotate_left)
1479-
#[cfg(not(stage0))]
14801478
pub fn rotate_left<T>(x: T, y: T) -> T;
14811479

14821480
/// Performs rotate right.
14831481
/// The stabilized versions of this intrinsic are available on the integer
14841482
/// primitives via the `rotate_right` method. For example,
14851483
/// [`std::u32::rotate_right`](../../std/primitive.u32.html#method.rotate_right)
1486-
#[cfg(not(stage0))]
14871484
pub fn rotate_right<T>(x: T, y: T) -> T;
14881485

14891486
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.

src/libcore/mem.rs

-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ pub fn forget<T>(t: T) {
149149
///
150150
/// [`forget`]: fn.forget.html
151151
#[inline]
152-
#[cfg(not(stage0))]
153152
#[unstable(feature = "forget_unsized", issue = "0")]
154153
pub fn forget_unsized<T: ?Sized>(t: T) {
155154
unsafe { intrinsics::forget(t) }

src/libcore/num/mod.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -2330,12 +2330,7 @@ assert_eq!(n.rotate_left(", $rot, "), m);
23302330
#[rustc_const_unstable(feature = "const_int_rotate")]
23312331
#[inline]
23322332
pub const fn rotate_left(self, n: u32) -> Self {
2333-
#[cfg(not(stage0))] {
2334-
unsafe { intrinsics::rotate_left(self, n as $SelfT) }
2335-
}
2336-
#[cfg(stage0)] {
2337-
(self << (n % $BITS)) | (self >> (($BITS - (n % $BITS)) % $BITS))
2338-
}
2333+
unsafe { intrinsics::rotate_left(self, n as $SelfT) }
23392334
}
23402335
}
23412336

@@ -2360,12 +2355,7 @@ assert_eq!(n.rotate_right(", $rot, "), m);
23602355
#[rustc_const_unstable(feature = "const_int_rotate")]
23612356
#[inline]
23622357
pub const fn rotate_right(self, n: u32) -> Self {
2363-
#[cfg(not(stage0))] {
2364-
unsafe { intrinsics::rotate_right(self, n as $SelfT) }
2365-
}
2366-
#[cfg(stage0)] {
2367-
(self >> (n % $BITS)) | (self << (($BITS - (n % $BITS)) % $BITS))
2368-
}
2358+
unsafe { intrinsics::rotate_right(self, n as $SelfT) }
23692359
}
23702360
}
23712361

src/libcore/ops/unsize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
9393
/// {}
9494
/// ```
9595
#[unstable(feature = "dispatch_from_dyn", issue = "0")]
96-
#[cfg_attr(not(stage0), lang = "dispatch_from_dyn")]
96+
#[lang = "dispatch_from_dyn"]
9797
pub trait DispatchFromDyn<T> {
9898
// Empty.
9999
}

src/libcore/sync/atomic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ atomic_int! {
19401940
8,
19411941
u64 AtomicU64 ATOMIC_U64_INIT
19421942
}
1943-
#[cfg(all(not(stage0), target_has_atomic = "128"))]
1943+
#[cfg(target_has_atomic = "128")]
19441944
atomic_int! {
19451945
unstable(feature = "integer_atomics", issue = "32976"),
19461946
unstable(feature = "integer_atomics", issue = "32976"),
@@ -1954,7 +1954,7 @@ atomic_int! {
19541954
16,
19551955
i128 AtomicI128 ATOMIC_I128_INIT
19561956
}
1957-
#[cfg(all(not(stage0), target_has_atomic = "128"))]
1957+
#[cfg(target_has_atomic = "128")]
19581958
atomic_int! {
19591959
unstable(feature = "integer_atomics", issue = "32976"),
19601960
unstable(feature = "integer_atomics", issue = "32976"),

src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ impl BuiltinLintDiagnostics {
463463
Ok(ref s) => {
464464
// FIXME(Manishearth) ideally the emitting code
465465
// can tell us whether or not this is global
466-
let opt_colon = if s.trim_left().starts_with("::") {
466+
let opt_colon = if s.trim_start().starts_with("::") {
467467
""
468468
} else {
469469
"::"

src/librustc_errors/emitter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ impl EmitterWriter {
12621262

12631263
// Do not underline the leading...
12641264
let start = part.snippet.len()
1265-
.saturating_sub(part.snippet.trim_left().len());
1265+
.saturating_sub(part.snippet.trim_start().len());
12661266
// ...or trailing spaces. Account for substitutions containing unicode
12671267
// characters.
12681268
let sub_len = part.snippet.trim().chars().fold(0, |acc, ch| {

src/librustc_lint/nonstandard_style.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl NonSnakeCase {
169169
fn to_snake_case(mut str: &str) -> String {
170170
let mut words = vec![];
171171
// Preserve leading underscores
172-
str = str.trim_left_matches(|c: char| {
172+
str = str.trim_start_matches(|c: char| {
173173
if c == '_' {
174174
words.push(String::new());
175175
true
@@ -201,7 +201,7 @@ impl NonSnakeCase {
201201
if ident.is_empty() {
202202
return true;
203203
}
204-
let ident = ident.trim_left_matches('\'');
204+
let ident = ident.trim_start_matches('\'');
205205
let ident = ident.trim_matches('_');
206206

207207
let mut allow_underscore = true;

src/librustc_llvm/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ fn main() {
192192
// On MSVC llvm-config will print the full name to libraries, but
193193
// we're only interested in the name part
194194
let name = Path::new(lib).file_name().unwrap().to_str().unwrap();
195-
name.trim_right_matches(".lib")
195+
name.trim_end_matches(".lib")
196196
} else if lib.ends_with(".lib") {
197197
// Some MSVC libraries just come up with `.lib` tacked on, so chop
198198
// that off
199-
lib.trim_right_matches(".lib")
199+
lib.trim_end_matches(".lib")
200200
} else {
201201
continue;
202202
};

src/librustc_mir/borrow_check/move_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,13 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
426426
.span_to_snippet(pat_span)
427427
.unwrap();
428428
if pat_snippet.starts_with('&') {
429-
let pat_snippet = pat_snippet[1..].trim_left();
429+
let pat_snippet = pat_snippet[1..].trim_start();
430430
let suggestion;
431431
let to_remove;
432432
if pat_snippet.starts_with("mut")
433433
&& pat_snippet["mut".len()..].starts_with(Pattern_White_Space)
434434
{
435-
suggestion = pat_snippet["mut".len()..].trim_left();
435+
suggestion = pat_snippet["mut".len()..].trim_start();
436436
to_remove = "&mut";
437437
} else {
438438
suggestion = pat_snippet;

src/librustc_mir/interpret/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
103103
if bits == 0 {
104104
return err!(Intrinsic(format!("{} called on 0", intrinsic_name)));
105105
}
106-
numeric_intrinsic(intrinsic_name.trim_right_matches("_nonzero"), bits, kind)?
106+
numeric_intrinsic(intrinsic_name.trim_end_matches("_nonzero"), bits, kind)?
107107
} else {
108108
numeric_intrinsic(intrinsic_name, bits, kind)?
109109
};

src/librustc_typeck/check/demand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
123123
let sole_field_ty = sole_field.ty(self.tcx, substs);
124124
if self.can_coerce(expr_ty, sole_field_ty) {
125125
let variant_path = self.tcx.item_path_str(variant.did);
126-
Some(variant_path.trim_left_matches("std::prelude::v1::").to_string())
126+
Some(variant_path.trim_start_matches("std::prelude::v1::").to_string())
127127
} else {
128128
None
129129
}
@@ -519,7 +519,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
519519
let suffix_suggestion = format!(
520520
"{}{}{}{}",
521521
if needs_paren { "(" } else { "" },
522-
src.trim_right_matches(&checked_ty.to_string()),
522+
src.trim_end_matches(&checked_ty.to_string()),
523523
expected_ty,
524524
if needs_paren { ")" } else { "" },
525525
);

src/librustdoc/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn extract_leading_metadata<'a>(s: &'a str) -> (Vec<&'a str>, &'a str) {
3535
for line in s.lines() {
3636
if line.starts_with("# ") || line.starts_with("%") {
3737
// trim the whitespace after the symbol
38-
metadata.push(line[1..].trim_left());
38+
metadata.push(line[1..].trim_start());
3939
count += line.len() + 1;
4040
} else {
4141
return (metadata, &s[count..]);

src/librustdoc/passes/collect_intra_doc_links.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -295,23 +295,23 @@ impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for LinkCollector<'a, 'tcx, 'rcx, 'cstor
295295
"trait@", "union@"].iter()
296296
.find(|p| link.starts_with(**p)) {
297297
kind = PathKind::Type;
298-
link.trim_left_matches(prefix)
298+
link.trim_start_matches(prefix)
299299
} else if let Some(prefix) =
300300
["const@", "static@",
301301
"value@", "function@", "mod@",
302302
"fn@", "module@", "method@"]
303303
.iter().find(|p| link.starts_with(**p)) {
304304
kind = PathKind::Value;
305-
link.trim_left_matches(prefix)
305+
link.trim_start_matches(prefix)
306306
} else if link.ends_with("()") {
307307
kind = PathKind::Value;
308-
link.trim_right_matches("()")
308+
link.trim_end_matches("()")
309309
} else if link.starts_with("macro@") {
310310
kind = PathKind::Macro;
311-
link.trim_left_matches("macro@")
311+
link.trim_start_matches("macro@")
312312
} else if link.ends_with('!') {
313313
kind = PathKind::Macro;
314-
link.trim_right_matches('!')
314+
link.trim_end_matches('!')
315315
} else {
316316
&link[..]
317317
}.trim();

src/librustdoc/passes/unindent_comments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn unindent(s: &str) -> String {
9595
});
9696

9797
if !lines.is_empty() {
98-
let mut unindented = vec![ lines[0].trim_left().to_string() ];
98+
let mut unindented = vec![ lines[0].trim_start().to_string() ];
9999
unindented.extend_from_slice(&lines[1..].iter().map(|&line| {
100100
if line.chars().all(|c| c.is_whitespace()) {
101101
line.to_string()

src/libserialize/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3493,7 +3493,7 @@ mod tests {
34933493

34943494
// Helper function for counting indents
34953495
fn indents(source: &str) -> usize {
3496-
let trimmed = source.trim_left_matches(' ');
3496+
let trimmed = source.trim_start_matches(' ');
34973497
source.len() - trimmed.len()
34983498
}
34993499

src/libstd/error.rs

+1
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ impl<T: Error> Error for Box<T> {
533533
Error::description(&**self)
534534
}
535535

536+
#[allow(deprecated)]
536537
fn cause(&self) -> Option<&dyn Error> {
537538
Error::cause(&**self)
538539
}

src/libstd/ffi/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ pub use self::os_str::{OsString, OsStr};
174174
#[stable(feature = "raw_os", since = "1.1.0")]
175175
pub use core::ffi::c_void;
176176

177-
#[cfg(not(stage0))]
178177
#[unstable(feature = "c_variadic",
179178
reason = "the `c_variadic` feature has not been properly tested on \
180179
all supported platforms",

src/libstd/io/error.rs

+1
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ impl error::Error for Error {
555555
}
556556
}
557557

558+
#[allow(deprecated)]
558559
fn cause(&self) -> Option<&dyn error::Error> {
559560
match self.repr {
560561
Repr::Os(..) => None,

src/libstd/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,6 @@
317317

318318
#![default_lib_allocator]
319319

320-
#[cfg(stage0)]
321-
#[global_allocator]
322-
static ALLOC: alloc::System = alloc::System;
323-
324320
// Explicitly import the prelude. The compiler uses this same unstable attribute
325321
// to import the prelude implicitly when building crates that depend on std.
326322
#[prelude_import]

src/libstd/panic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl RefUnwindSafe for atomic::AtomicI32 {}
264264
#[cfg(target_has_atomic = "64")]
265265
#[unstable(feature = "integer_atomics", issue = "32976")]
266266
impl RefUnwindSafe for atomic::AtomicI64 {}
267-
#[cfg(all(not(stage0), target_has_atomic = "128"))]
267+
#[cfg(target_has_atomic = "128")]
268268
#[unstable(feature = "integer_atomics", issue = "32976")]
269269
impl RefUnwindSafe for atomic::AtomicI128 {}
270270

@@ -283,7 +283,7 @@ impl RefUnwindSafe for atomic::AtomicU32 {}
283283
#[cfg(target_has_atomic = "64")]
284284
#[unstable(feature = "integer_atomics", issue = "32976")]
285285
impl RefUnwindSafe for atomic::AtomicU64 {}
286-
#[cfg(all(not(stage0), target_has_atomic = "128"))]
286+
#[cfg(target_has_atomic = "128")]
287287
#[unstable(feature = "integer_atomics", issue = "32976")]
288288
impl RefUnwindSafe for atomic::AtomicU128 {}
289289

src/libsyntax/diagnostics/plugin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
141141
])
142142
}
143143

144+
#[allow(deprecated)]
144145
pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
145146
span: Span,
146147
token_tree: &[TokenTree])

src/libsyntax/source_map.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl SourceMap {
581581
match self.span_to_prev_source(sp) {
582582
Err(_) => None,
583583
Ok(source) => source.split('\n').last().map(|last_line| {
584-
last_line.len() - last_line.trim_left().len()
584+
last_line.len() - last_line.trim_start().len()
585585
})
586586
}
587587
}
@@ -595,7 +595,7 @@ impl SourceMap {
595595
/// if no character could be found or if an error occurred while retrieving the code snippet.
596596
pub fn span_extend_to_prev_char(&self, sp: Span, c: char) -> Span {
597597
if let Ok(prev_source) = self.span_to_prev_source(sp) {
598-
let prev_source = prev_source.rsplit(c).nth(0).unwrap_or("").trim_left();
598+
let prev_source = prev_source.rsplit(c).nth(0).unwrap_or("").trim_start();
599599
if !prev_source.is_empty() && !prev_source.contains('\n') {
600600
return sp.with_lo(BytePos(sp.lo().0 - prev_source.len() as u32));
601601
}
@@ -615,7 +615,7 @@ impl SourceMap {
615615
for ws in &[" ", "\t", "\n"] {
616616
let pat = pat.to_owned() + ws;
617617
if let Ok(prev_source) = self.span_to_prev_source(sp) {
618-
let prev_source = prev_source.rsplit(&pat).nth(0).unwrap_or("").trim_left();
618+
let prev_source = prev_source.rsplit(&pat).nth(0).unwrap_or("").trim_start();
619619
if !prev_source.is_empty() && (!prev_source.contains('\n') || accept_newlines) {
620620
return sp.with_lo(BytePos(sp.lo().0 - prev_source.len() as u32));
621621
}
@@ -629,7 +629,7 @@ impl SourceMap {
629629
pub fn span_until_char(&self, sp: Span, c: char) -> Span {
630630
match self.span_to_snippet(sp) {
631631
Ok(snippet) => {
632-
let snippet = snippet.split(c).nth(0).unwrap_or("").trim_right();
632+
let snippet = snippet.split(c).nth(0).unwrap_or("").trim_end();
633633
if !snippet.is_empty() && !snippet.contains('\n') {
634634
sp.with_hi(BytePos(sp.lo().0 + snippet.len() as u32))
635635
} else {

0 commit comments

Comments
 (0)