Skip to content

Commit

Permalink
Auto merge of #42495 - alexcrichton:new-stage0, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Bump to 1.20.0 and update stage0 compiler

Betas are hot off the bots, let's get them while they're fresh.
  • Loading branch information
bors committed Jun 20, 2017
2 parents 1143eb2 + be7ebdd commit 753fee4
Show file tree
Hide file tree
Showing 47 changed files with 24 additions and 283 deletions.
10 changes: 5 additions & 5 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 2 additions & 17 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ fn main() {
cmd.arg("-Cprefer-dynamic");
}

// Pass the `rustbuild` feature flag to crates which rustbuild is
// building. See the comment in bootstrap/lib.rs where this env var is
// set for more details.
if env::var_os("RUSTBUILD_UNSTABLE").is_some() {
cmd.arg("--cfg").arg("rustbuild");
}

// Help the libc crate compile by assisting it in finding the MUSL
// native libraries.
if let Some(s) = env::var_os("MUSL_ROOT") {
Expand Down Expand Up @@ -218,11 +211,7 @@ fn main() {
// do that we pass a weird flag to the compiler to get it to do
// so. Note that this is definitely a hack, and we should likely
// flesh out rpath support more fully in the future.
//
// FIXME: remove condition after next stage0
if stage != "0" {
cmd.arg("-Z").arg("osx-rpath-install-name");
}
cmd.arg("-Z").arg("osx-rpath-install-name");
Some("-Wl,-rpath,@loader_path/../lib")
} else if !target.contains("windows") {
Some("-Wl,-rpath,$ORIGIN/../lib")
Expand All @@ -242,12 +231,8 @@ fn main() {
// Force all crates compiled by this compiler to (a) be unstable and (b)
// allow the `rustc_private` feature to link to other unstable crates
// also in the sysroot.
//
// FIXME: remove condition after next stage0
if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() {
if stage != "0" {
cmd.arg("-Z").arg("force-unstable-if-unmarked");
}
cmd.arg("-Z").arg("force-unstable-if-unmarked");
}
}

Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def build_bootstrap(self):
if self.clean and os.path.exists(build_dir):
shutil.rmtree(build_dir)
env = os.environ.copy()
env["RUSTC_BOOTSTRAP"] = '1'
env["CARGO_TARGET_DIR"] = build_dir
env["RUSTC"] = self.rustc()
env["LD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use build_helper::output;
use Build;

// The version number
pub const CFG_RELEASE_NUM: &'static str = "1.19.0";
pub const CFG_RELEASE_NUM: &'static str = "1.20.0";

// An optional number to put after the label, e.g. '.2' -> '-beta.2'
// Be sure to make this starts with a dot to conform to semver pre-release
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ pub fn bootstrap(build: &Build) {
cmd.arg("test")
.current_dir(build.src.join("src/bootstrap"))
.env("CARGO_TARGET_DIR", build.out.join("bootstrap"))
.env("RUSTC_BOOTSTRAP", "1")
.env("RUSTC", &build.rustc);
if build.flags.cmd.no_fail_fast() {
cmd.arg("--no-fail-fast");
Expand Down
23 changes: 0 additions & 23 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,29 +429,6 @@ impl Build {
.env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler));
}

// There are two invariants we must maintain:
// * stable crates cannot depend on unstable crates (general Rust rule),
// * crates that end up in the sysroot must be unstable (rustbuild rule).
//
// In order to do enforce the latter, we pass the env var
// `RUSTBUILD_UNSTABLE` down the line for any crates which will end up
// in the sysroot. We read this in bootstrap/bin/rustc.rs and if it is
// set, then we pass the `rustbuild` feature to rustc when building the
// the crate.
//
// In turn, crates that can be used here should recognise the `rustbuild`
// feature and opt-in to `rustc_private`.
//
// We can't always pass `rustbuild` because crates which are outside of
// the compiler, libs, and tests are stable and we don't want to make
// their deps unstable (since this would break the first invariant
// above).
//
// FIXME: remove this after next stage0
if mode != Mode::Tool && stage == 0 {
cargo.env("RUSTBUILD_UNSTABLE", "1");
}

// Ignore incremental modes except for stage0, since we're
// not guaranteeing correctness across builds if the compiler
// is changing under your feet.`
Expand Down

This file was deleted.

5 changes: 5 additions & 0 deletions src/liballoc_jemalloc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ fn main() {
make.current_dir(&native.out_dir)
.arg("build_lib_static");

// These are intended for mingw32-make which we don't use
if cfg!(windows) {
make.env_remove("MAKEFLAGS").env_remove("MFLAGS");
}

// mingw make seems... buggy? unclear...
if !host.contains("windows") {
make.arg("-j")
Expand Down
2 changes: 0 additions & 2 deletions src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
//! objects of a single type.
#![crate_name = "arena"]
#![cfg_attr(stage0, unstable(feature = "rustc_private", issue = "27812"))]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
Expand All @@ -33,7 +32,6 @@
#![feature(dropck_eyepatch)]
#![feature(generic_param_attrs)]
#![feature(needs_drop)]
#![cfg_attr(stage0, feature(staged_api))]
#![cfg_attr(test, feature(test))]

#![allow(deprecated)]
Expand Down
14 changes: 0 additions & 14 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,6 @@ extern "rust-intrinsic" {
///
/// The `locality` argument must be a constant integer and is a temporal locality specifier
/// ranging from (0) - no locality, to (3) - extremely local keep in cache
#[cfg(not(stage0))]
pub fn prefetch_read_data<T>(data: *const T, locality: i32);
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
/// if supported; otherwise, it is a noop.
Expand All @@ -581,7 +580,6 @@ extern "rust-intrinsic" {
///
/// The `locality` argument must be a constant integer and is a temporal locality specifier
/// ranging from (0) - no locality, to (3) - extremely local keep in cache
#[cfg(not(stage0))]
pub fn prefetch_write_data<T>(data: *const T, locality: i32);
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
/// if supported; otherwise, it is a noop.
Expand All @@ -590,7 +588,6 @@ extern "rust-intrinsic" {
///
/// The `locality` argument must be a constant integer and is a temporal locality specifier
/// ranging from (0) - no locality, to (3) - extremely local keep in cache
#[cfg(not(stage0))]
pub fn prefetch_read_instruction<T>(data: *const T, locality: i32);
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
/// if supported; otherwise, it is a noop.
Expand All @@ -599,20 +596,9 @@ extern "rust-intrinsic" {
///
/// The `locality` argument must be a constant integer and is a temporal locality specifier
/// ranging from (0) - no locality, to (3) - extremely local keep in cache
#[cfg(not(stage0))]
pub fn prefetch_write_instruction<T>(data: *const T, locality: i32);
}

// Empty bootstrap implementations for stage0 compilation
#[cfg(stage0)]
pub fn prefetch_read_data<T>(_data: *const T, _locality: i32) { /* EMPTY */ }
#[cfg(stage0)]
pub fn prefetch_write_data<T>(_data: *const T, _locality: i32) { /* EMPTY */ }
#[cfg(stage0)]
pub fn prefetch_read_instruction<T>(_data: *const T, _locality: i32) { /* EMPTY */ }
#[cfg(stage0)]
pub fn prefetch_write_instruction<T>(_data: *const T, _locality: i32) { /* EMPTY */ }

extern "rust-intrinsic" {

pub fn atomic_fence();
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ pub use self::range::{Range, RangeFrom, RangeFull, RangeTo};
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
pub use self::range::{RangeInclusive, RangeToInclusive};

#[unstable(feature = "question_mark_carrier", issue = "31436")]
#[cfg(stage0)]
pub use self::try::Carrier;
#[unstable(feature = "try_trait", issue = "42327")]
pub use self::try::Try;

Expand Down
64 changes: 0 additions & 64 deletions src/libcore/ops/try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,70 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

/// This trait has been superseded by the `Try` trait, but must remain
/// here as `?` is still lowered to it in stage0 .
#[cfg(stage0)]
#[unstable(feature = "question_mark_carrier", issue = "31436")]
pub trait Carrier {
/// The type of the value when computation succeeds.
type Success;
/// The type of the value when computation errors out.
type Error;

/// Create a `Carrier` from a success value.
fn from_success(_: Self::Success) -> Self;

/// Create a `Carrier` from an error value.
fn from_error(_: Self::Error) -> Self;

/// Translate this `Carrier` to another implementation of `Carrier` with the
/// same associated types.
fn translate<T>(self) -> T where T: Carrier<Success=Self::Success, Error=Self::Error>;
}

#[cfg(stage0)]
#[unstable(feature = "question_mark_carrier", issue = "31436")]
impl<U, V> Carrier for Result<U, V> {
type Success = U;
type Error = V;

fn from_success(u: U) -> Result<U, V> {
Ok(u)
}

fn from_error(e: V) -> Result<U, V> {
Err(e)
}

fn translate<T>(self) -> T
where T: Carrier<Success=U, Error=V>
{
match self {
Ok(u) => T::from_success(u),
Err(e) => T::from_error(e),
}
}
}

struct _DummyErrorType;

impl Try for _DummyErrorType {
type Ok = ();
type Error = ();

fn into_result(self) -> Result<Self::Ok, Self::Error> {
Ok(())
}

fn from_ok(_: ()) -> _DummyErrorType {
_DummyErrorType
}

fn from_error(_: ()) -> _DummyErrorType {
_DummyErrorType
}
}

/// A trait for customizing the behaviour of the `?` operator.
///
/// A type implementing `Try` is one that has a canonical way to view it
Expand Down
21 changes: 6 additions & 15 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1030,47 +1030,38 @@ impl<T> SliceIndex<[T]> for ops::RangeInclusive<usize> {
}
}

#[cfg(stage0)] // The bootstrap compiler has a different `...` desugar
fn inclusive(start: usize, end: usize) -> ops::RangeInclusive<usize> {
ops::RangeInclusive { start, end }
}
#[cfg(not(stage0))]
fn inclusive(start: usize, end: usize) -> ops::RangeInclusive<usize> {
start...end
}

#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
type Output = [T];

#[inline]
fn get(self, slice: &[T]) -> Option<&[T]> {
inclusive(0, self.end).get(slice)
(0...self.end).get(slice)
}

#[inline]
fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> {
inclusive(0, self.end).get_mut(slice)
(0...self.end).get_mut(slice)
}

#[inline]
unsafe fn get_unchecked(self, slice: &[T]) -> &[T] {
inclusive(0, self.end).get_unchecked(slice)
(0...self.end).get_unchecked(slice)
}

#[inline]
unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] {
inclusive(0, self.end).get_unchecked_mut(slice)
(0...self.end).get_unchecked_mut(slice)
}

#[inline]
fn index(self, slice: &[T]) -> &[T] {
inclusive(0, self.end).index(slice)
(0...self.end).index(slice)
}

#[inline]
fn index_mut(self, slice: &mut [T]) -> &mut [T] {
inclusive(0, self.end).index_mut(slice)
(0...self.end).index_mut(slice)
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/libflate/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//! [mz]: https://code.google.com/p/miniz/
#![crate_name = "flate"]
#![cfg_attr(stage0, unstable(feature = "rustc_private", issue = "27812"))]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
Expand All @@ -25,7 +24,6 @@
#![deny(warnings)]

#![feature(libc)]
#![cfg_attr(stage0, feature(staged_api))]
#![feature(unique)]
#![cfg_attr(test, feature(rand))]

Expand Down
4 changes: 0 additions & 4 deletions src/libfmt_macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//! generated instead.
#![crate_name = "fmt_macros"]
#![cfg_attr(stage0, unstable(feature = "rustc_private", issue = "27812"))]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
Expand All @@ -25,9 +24,6 @@
test(attr(deny(warnings))))]
#![deny(warnings)]

#![cfg_attr(stage0, feature(staged_api))]
#![feature(rustc_private)]

pub use self::Piece::*;
pub use self::Position::*;
pub use self::Alignment::*;
Expand Down
Loading

0 comments on commit 753fee4

Please sign in to comment.