Skip to content

Commit a850bb0

Browse files
committed
Update bootstrap compiler
Also remove a number of `stage0` annotations and such
1 parent 78fcf33 commit a850bb0

File tree

13 files changed

+66
-289
lines changed

13 files changed

+66
-289
lines changed

src/Cargo.lock

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

src/bootstrap/bin/rustc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ fn main() {
175175
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
176176
cmd.arg("-C").arg(format!("codegen-units={}", s));
177177
}
178-
if stage != "0" && env::var("RUSTC_THINLTO").is_ok() {
178+
if env::var("RUSTC_THINLTO").is_ok() {
179179
cmd.arg("-Ccodegen-units=16").arg("-Zthinlto");
180180
}
181181

src/liballoc/boxed.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,7 @@ impl<T: ?Sized> Box<T> {
300300
issue = "27730")]
301301
#[inline]
302302
pub unsafe fn from_unique(u: Unique<T>) -> Self {
303-
#[cfg(stage0)]
304-
return mem::transmute(u);
305-
#[cfg(not(stage0))]
306-
return Box(u);
303+
Box(u)
307304
}
308305

309306
/// Consumes the `Box`, returning the wrapped raw pointer.
@@ -365,14 +362,9 @@ impl<T: ?Sized> Box<T> {
365362
issue = "27730")]
366363
#[inline]
367364
pub fn into_unique(b: Box<T>) -> Unique<T> {
368-
#[cfg(stage0)]
369-
return unsafe { mem::transmute(b) };
370-
#[cfg(not(stage0))]
371-
return {
372-
let unique = b.0;
373-
mem::forget(b);
374-
unique
375-
};
365+
let unique = b.0;
366+
mem::forget(b);
367+
unique
376368
}
377369

378370
/// Consumes and leaks the `Box`, returning a mutable reference,

src/liballoc/slice.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1626,11 +1626,8 @@ impl<T> [T] {
16261626
}
16271627
}
16281628

1629-
// FIXME(LukasKalbertodt): the `not(stage0)` constraint can be removed in the
1630-
// future once the stage0 compiler is new enough to know about the `slice_u8`
1631-
// lang item.
16321629
#[lang = "slice_u8"]
1633-
#[cfg(all(not(stage0), not(test)))]
1630+
#[cfg(not(test))]
16341631
impl [u8] {
16351632
/// Checks if all bytes in this slice are within the ASCII range.
16361633
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]

src/liballoc/str.rs

-5
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,6 @@ impl str {
21102110
/// [`to_uppercase`]: #method.to_uppercase
21112111
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
21122112
#[inline]
2113-
#[cfg(not(stage0))]
21142113
pub fn to_ascii_uppercase(&self) -> String {
21152114
let mut bytes = self.as_bytes().to_vec();
21162115
bytes.make_ascii_uppercase();
@@ -2141,7 +2140,6 @@ impl str {
21412140
/// [`to_lowercase`]: #method.to_lowercase
21422141
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
21432142
#[inline]
2144-
#[cfg(not(stage0))]
21452143
pub fn to_ascii_lowercase(&self) -> String {
21462144
let mut bytes = self.as_bytes().to_vec();
21472145
bytes.make_ascii_lowercase();
@@ -2163,7 +2161,6 @@ impl str {
21632161
/// ```
21642162
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
21652163
#[inline]
2166-
#[cfg(not(stage0))]
21672164
pub fn eq_ignore_ascii_case(&self, other: &str) -> bool {
21682165
self.as_bytes().eq_ignore_ascii_case(other.as_bytes())
21692166
}
@@ -2178,7 +2175,6 @@ impl str {
21782175
///
21792176
/// [`to_ascii_uppercase`]: #method.to_ascii_uppercase
21802177
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2181-
#[cfg(not(stage0))]
21822178
pub fn make_ascii_uppercase(&mut self) {
21832179
let me = unsafe { self.as_bytes_mut() };
21842180
me.make_ascii_uppercase()
@@ -2194,7 +2190,6 @@ impl str {
21942190
///
21952191
/// [`to_ascii_lowercase`]: #method.to_ascii_lowercase
21962192
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.21.0")]
2197-
#[cfg(not(stage0))]
21982193
pub fn make_ascii_lowercase(&mut self) {
21992194
let me = unsafe { self.as_bytes_mut() };
22002195
me.make_ascii_lowercase()

src/libcore/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
#![feature(unboxed_closures)]
9191
#![feature(untagged_unions)]
9292
#![feature(unwind_attributes)]
93-
#![cfg_attr(not(stage0), feature(doc_spotlight))]
93+
#![feature(doc_spotlight)]
9494

9595
#[prelude_import]
9696
#[allow(unused)]

src/libcore/marker.rs

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ use hash::Hasher;
3939
/// [arc]: ../../std/sync/struct.Arc.html
4040
/// [ub]: ../../reference/behavior-considered-undefined.html
4141
#[stable(feature = "rust1", since = "1.0.0")]
42-
#[cfg_attr(stage0, lang = "send")]
4342
#[rustc_on_unimplemented = "`{Self}` cannot be sent between threads safely"]
4443
pub unsafe trait Send {
4544
// empty.

src/librustc/lint/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ use hir::def_id::{CrateNum, LOCAL_CRATE};
3838
use hir::intravisit::{self, FnKind};
3939
use hir;
4040
use session::Session;
41-
#[cfg(stage0)]
42-
use std::ascii::AsciiExt;
4341
use std::hash;
4442
use syntax::ast;
4543
use syntax::codemap::MultiSpan;

src/librustdoc/clean/cfg.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
use std::mem;
1616
use std::fmt::{self, Write};
1717
use std::ops;
18-
#[cfg(stage0)]
19-
use std::ascii::AsciiExt;
2018

2119
use syntax::symbol::Symbol;
2220
use syntax::ast::{MetaItem, MetaItemKind, NestedMetaItem, NestedMetaItemKind, LitKind};

src/librustdoc/html/render.rs

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
//! both occur before the crate is rendered.
3535
pub use self::ExternalLocation::*;
3636

37-
#[cfg(stage0)]
38-
use std::ascii::AsciiExt;
3937
use std::borrow::Cow;
4038
use std::cell::RefCell;
4139
use std::cmp::Ordering;

src/libstd/ascii.rs

-200
Original file line numberDiff line numberDiff line change
@@ -298,198 +298,6 @@ pub trait AsciiExt {
298298
fn is_ascii_control(&self) -> bool { unimplemented!(); }
299299
}
300300

301-
// FIXME(LukasKalbertodt): this impl block can be removed in the future. This is
302-
// possible once the stage0 compiler is new enough to contain the inherent
303-
// ascii methods for `[str]`. See FIXME comment further down.
304-
#[cfg(stage0)]
305-
#[stable(feature = "rust1", since = "1.0.0")]
306-
impl AsciiExt for str {
307-
type Owned = String;
308-
309-
#[inline]
310-
fn is_ascii(&self) -> bool {
311-
self.bytes().all(|b| b.is_ascii())
312-
}
313-
314-
#[inline]
315-
fn to_ascii_uppercase(&self) -> String {
316-
let mut bytes = self.as_bytes().to_vec();
317-
bytes.make_ascii_uppercase();
318-
// make_ascii_uppercase() preserves the UTF-8 invariant.
319-
unsafe { String::from_utf8_unchecked(bytes) }
320-
}
321-
322-
#[inline]
323-
fn to_ascii_lowercase(&self) -> String {
324-
let mut bytes = self.as_bytes().to_vec();
325-
bytes.make_ascii_lowercase();
326-
// make_ascii_uppercase() preserves the UTF-8 invariant.
327-
unsafe { String::from_utf8_unchecked(bytes) }
328-
}
329-
330-
#[inline]
331-
fn eq_ignore_ascii_case(&self, other: &str) -> bool {
332-
self.as_bytes().eq_ignore_ascii_case(other.as_bytes())
333-
}
334-
335-
fn make_ascii_uppercase(&mut self) {
336-
let me = unsafe { self.as_bytes_mut() };
337-
me.make_ascii_uppercase()
338-
}
339-
340-
fn make_ascii_lowercase(&mut self) {
341-
let me = unsafe { self.as_bytes_mut() };
342-
me.make_ascii_lowercase()
343-
}
344-
345-
#[inline]
346-
fn is_ascii_alphabetic(&self) -> bool {
347-
self.bytes().all(|b| b.is_ascii_alphabetic())
348-
}
349-
350-
#[inline]
351-
fn is_ascii_uppercase(&self) -> bool {
352-
self.bytes().all(|b| b.is_ascii_uppercase())
353-
}
354-
355-
#[inline]
356-
fn is_ascii_lowercase(&self) -> bool {
357-
self.bytes().all(|b| b.is_ascii_lowercase())
358-
}
359-
360-
#[inline]
361-
fn is_ascii_alphanumeric(&self) -> bool {
362-
self.bytes().all(|b| b.is_ascii_alphanumeric())
363-
}
364-
365-
#[inline]
366-
fn is_ascii_digit(&self) -> bool {
367-
self.bytes().all(|b| b.is_ascii_digit())
368-
}
369-
370-
#[inline]
371-
fn is_ascii_hexdigit(&self) -> bool {
372-
self.bytes().all(|b| b.is_ascii_hexdigit())
373-
}
374-
375-
#[inline]
376-
fn is_ascii_punctuation(&self) -> bool {
377-
self.bytes().all(|b| b.is_ascii_punctuation())
378-
}
379-
380-
#[inline]
381-
fn is_ascii_graphic(&self) -> bool {
382-
self.bytes().all(|b| b.is_ascii_graphic())
383-
}
384-
385-
#[inline]
386-
fn is_ascii_whitespace(&self) -> bool {
387-
self.bytes().all(|b| b.is_ascii_whitespace())
388-
}
389-
390-
#[inline]
391-
fn is_ascii_control(&self) -> bool {
392-
self.bytes().all(|b| b.is_ascii_control())
393-
}
394-
}
395-
396-
// FIXME(LukasKalbertodt): this impl block can be removed in the future. This is
397-
// possible once the stage0 compiler is new enough to contain the inherent
398-
// ascii methods for `[u8]`. See FIXME comment further down.
399-
#[cfg(stage0)]
400-
#[stable(feature = "rust1", since = "1.0.0")]
401-
impl AsciiExt for [u8] {
402-
type Owned = Vec<u8>;
403-
#[inline]
404-
fn is_ascii(&self) -> bool {
405-
self.iter().all(|b| b.is_ascii())
406-
}
407-
408-
#[inline]
409-
fn to_ascii_uppercase(&self) -> Vec<u8> {
410-
let mut me = self.to_vec();
411-
me.make_ascii_uppercase();
412-
return me
413-
}
414-
415-
#[inline]
416-
fn to_ascii_lowercase(&self) -> Vec<u8> {
417-
let mut me = self.to_vec();
418-
me.make_ascii_lowercase();
419-
return me
420-
}
421-
422-
#[inline]
423-
fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool {
424-
self.len() == other.len() &&
425-
self.iter().zip(other).all(|(a, b)| {
426-
a.eq_ignore_ascii_case(b)
427-
})
428-
}
429-
430-
fn make_ascii_uppercase(&mut self) {
431-
for byte in self {
432-
byte.make_ascii_uppercase();
433-
}
434-
}
435-
436-
fn make_ascii_lowercase(&mut self) {
437-
for byte in self {
438-
byte.make_ascii_lowercase();
439-
}
440-
}
441-
442-
#[inline]
443-
fn is_ascii_alphabetic(&self) -> bool {
444-
self.iter().all(|b| b.is_ascii_alphabetic())
445-
}
446-
447-
#[inline]
448-
fn is_ascii_uppercase(&self) -> bool {
449-
self.iter().all(|b| b.is_ascii_uppercase())
450-
}
451-
452-
#[inline]
453-
fn is_ascii_lowercase(&self) -> bool {
454-
self.iter().all(|b| b.is_ascii_lowercase())
455-
}
456-
457-
#[inline]
458-
fn is_ascii_alphanumeric(&self) -> bool {
459-
self.iter().all(|b| b.is_ascii_alphanumeric())
460-
}
461-
462-
#[inline]
463-
fn is_ascii_digit(&self) -> bool {
464-
self.iter().all(|b| b.is_ascii_digit())
465-
}
466-
467-
#[inline]
468-
fn is_ascii_hexdigit(&self) -> bool {
469-
self.iter().all(|b| b.is_ascii_hexdigit())
470-
}
471-
472-
#[inline]
473-
fn is_ascii_punctuation(&self) -> bool {
474-
self.iter().all(|b| b.is_ascii_punctuation())
475-
}
476-
477-
#[inline]
478-
fn is_ascii_graphic(&self) -> bool {
479-
self.iter().all(|b| b.is_ascii_graphic())
480-
}
481-
482-
#[inline]
483-
fn is_ascii_whitespace(&self) -> bool {
484-
self.iter().all(|b| b.is_ascii_whitespace())
485-
}
486-
487-
#[inline]
488-
fn is_ascii_control(&self) -> bool {
489-
self.iter().all(|b| b.is_ascii_control())
490-
}
491-
}
492-
493301
macro_rules! delegating_ascii_methods {
494302
() => {
495303
#[inline]
@@ -562,10 +370,6 @@ impl AsciiExt for char {
562370
delegating_ascii_ctype_methods!();
563371
}
564372

565-
// FIXME(LukasKalbertodt): the macro invocation should replace the impl block
566-
// for `[u8]` above. But this is not possible until the stage0 compiler is new
567-
// enough to contain the inherent ascii methods for `[u8]`.
568-
#[cfg(not(stage0))]
569373
#[stable(feature = "rust1", since = "1.0.0")]
570374
impl AsciiExt for [u8] {
571375
type Owned = Vec<u8>;
@@ -623,10 +427,6 @@ impl AsciiExt for [u8] {
623427
}
624428
}
625429

626-
// FIXME(LukasKalbertodt): the macro invocation should replace the impl block
627-
// for `str` above. But this is not possible until the stage0 compiler is new
628-
// enough to contain the inherent ascii methods for `str`.
629-
#[cfg(not(stage0))]
630430
#[stable(feature = "rust1", since = "1.0.0")]
631431
impl AsciiExt for str {
632432
type Owned = String;

src/stage0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
1313
# `0.x.0` for Cargo where they were released on `date`.
1414

15-
date: 2017-10-20
15+
date: 2017-11-21
1616
rustc: beta
1717
cargo: beta
1818

0 commit comments

Comments
 (0)