Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to bootstrapping from 1.27 #50629

Merged
merged 4 commits into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,10 @@ impl<'a> Builder<'a> {
cargo.env("RUST_CHECK", "1");
}

// If we were invoked from `make` then that's already got a jobserver
// set up for us so no need to tell Cargo about jobs all over again.
if env::var_os("MAKEFLAGS").is_none() && env::var_os("MFLAGS").is_none() {
cargo.arg("-j").arg(self.jobs().to_string());
}
cargo.arg("-j").arg(self.jobs().to_string());
// Remove make-related flags to ensure Cargo can correctly set things up
cargo.env_remove("MAKEFLAGS");
cargo.env_remove("MFLAGS");

// FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
// Force cargo to output binaries with disambiguating hashes in the name
Expand Down
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.27.0";
pub const CFG_RELEASE_NUM: &str = "1.28.0";

pub struct GitInfo {
inner: Option<Info>,
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ impl Step for Assemble {

// Link the compiler binary itself into place
let out_dir = builder.cargo_out(build_compiler, Mode::Librustc, host);
let rustc = out_dir.join(exe("rustc", &*host));
let rustc = out_dir.join(exe("rustc_binary", &*host));
let bindir = sysroot.join("bin");
t!(fs::create_dir_all(&bindir));
let compiler = builder.rustc(target_compiler);
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ impl Step for Rustdoc {
// the wrong rustdoc being executed. To avoid the conflicting rustdocs, we name the "tool"
// rustdoc a different name.
let tool_rustdoc = builder.cargo_out(build_compiler, Mode::Tool, target)
.join(exe("rustdoc-tool-binary", &target_compiler.host));
.join(exe("rustdoc_tool_binary", &target_compiler.host));

// don't create a stage0-sysroot/bin directory.
if target_compiler.stage > 0 {
Expand Down
2 changes: 2 additions & 0 deletions src/liballoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
authors = ["The Rust Project Developers"]
name = "alloc"
version = "0.0.0"
autotests = false
autobenches = false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is right but I'd like confirmation.


[lib]
name = "alloc"
Expand Down
47 changes: 1 addition & 46 deletions src/liballoc/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,6 @@ use core::usize;
#[doc(inline)]
pub use core::alloc::*;

#[cfg(stage0)]
extern "Rust" {
#[allocator]
#[rustc_allocator_nounwind]
fn __rust_alloc(size: usize, align: usize, err: *mut u8) -> *mut u8;
#[cold]
#[rustc_allocator_nounwind]
fn __rust_oom(err: *const u8) -> !;
#[rustc_allocator_nounwind]
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
#[rustc_allocator_nounwind]
fn __rust_realloc(ptr: *mut u8,
old_size: usize,
old_align: usize,
new_size: usize,
new_align: usize,
err: *mut u8) -> *mut u8;
#[rustc_allocator_nounwind]
fn __rust_alloc_zeroed(size: usize, align: usize, err: *mut u8) -> *mut u8;
}

#[cfg(not(stage0))]
extern "Rust" {
#[allocator]
#[rustc_allocator_nounwind]
Expand Down Expand Up @@ -74,10 +52,7 @@ pub const Heap: Global = Global;
unsafe impl GlobalAlloc for Global {
#[inline]
unsafe fn alloc(&self, layout: Layout) -> *mut Opaque {
#[cfg(not(stage0))]
let ptr = __rust_alloc(layout.size(), layout.align());
#[cfg(stage0)]
let ptr = __rust_alloc(layout.size(), layout.align(), &mut 0);
ptr as *mut Opaque
}

Expand All @@ -88,20 +63,13 @@ unsafe impl GlobalAlloc for Global {

#[inline]
unsafe fn realloc(&self, ptr: *mut Opaque, layout: Layout, new_size: usize) -> *mut Opaque {
#[cfg(not(stage0))]
let ptr = __rust_realloc(ptr as *mut u8, layout.size(), layout.align(), new_size);
#[cfg(stage0)]
let ptr = __rust_realloc(ptr as *mut u8, layout.size(), layout.align(),
new_size, layout.align(), &mut 0);
ptr as *mut Opaque
}

#[inline]
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut Opaque {
#[cfg(not(stage0))]
let ptr = __rust_alloc_zeroed(layout.size(), layout.align());
#[cfg(stage0)]
let ptr = __rust_alloc_zeroed(layout.size(), layout.align(), &mut 0);
ptr as *mut Opaque
}
}
Expand Down Expand Up @@ -152,14 +120,7 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
}
}

#[cfg(stage0)]
#[lang = "box_free"]
#[inline]
unsafe fn old_box_free<T: ?Sized>(ptr: *mut T) {
box_free(Unique::new_unchecked(ptr))
}

#[cfg_attr(not(any(test, stage0)), lang = "box_free")]
#[cfg_attr(not(test), lang = "box_free")]
#[inline]
pub(crate) unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
let ptr = ptr.as_ptr();
Expand All @@ -172,12 +133,6 @@ pub(crate) unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
}
}

#[cfg(stage0)]
pub fn oom() -> ! {
unsafe { ::core::intrinsics::abort() }
}

#[cfg(not(stage0))]
pub fn oom() -> ! {
extern {
#[lang = "oom"]
Expand Down
10 changes: 0 additions & 10 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
#![deny(missing_debug_implementations)]

#![cfg_attr(test, allow(deprecated))] // rand
#![cfg_attr(all(not(test), stage0), feature(float_internals))]
#![cfg_attr(not(test), feature(exact_size_is_empty))]
#![cfg_attr(not(test), feature(generator_trait))]
#![cfg_attr(test, feature(rand, test))]
Expand All @@ -90,13 +89,10 @@
#![feature(collections_range)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![cfg_attr(stage0, feature(core_slice_ext))]
#![cfg_attr(stage0, feature(core_str_ext))]
#![feature(custom_attribute)]
#![feature(dropck_eyepatch)]
#![feature(exact_size_is_empty)]
#![feature(fmt_internals)]
#![cfg_attr(stage0, feature(fn_must_use))]
#![feature(from_ref)]
#![feature(fundamental)]
#![feature(lang_items)]
Expand All @@ -122,7 +118,6 @@
#![feature(exact_chunks)]
#![feature(pointer_methods)]
#![feature(inclusive_range_methods)]
#![cfg_attr(stage0, feature(generic_param_attrs))]
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]

Expand Down Expand Up @@ -157,15 +152,10 @@ pub mod alloc;
#[unstable(feature = "allocator_api", issue = "32838")]
#[rustc_deprecated(since = "1.27.0", reason = "module renamed to `alloc`")]
/// Use the `alloc` module instead.
#[cfg(not(stage0))]
pub mod heap {
pub use alloc::*;
}

#[unstable(feature = "allocator_api", issue = "32838")]
#[rustc_deprecated(since = "1.27.0", reason = "module renamed to `alloc`")]
#[cfg(stage0)]
pub mod heap;

// Primitive types using the heaps above

Expand Down
13 changes: 2 additions & 11 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ use core::cmp::Ordering::{self, Less};
use core::mem::size_of;
use core::mem;
use core::ptr;
#[cfg(stage0)] use core::slice::SliceExt;
use core::{u8, u16, u32};

use borrow::{Borrow, BorrowMut, ToOwned};
Expand Down Expand Up @@ -171,13 +170,9 @@ mod hack {
}
}

#[cfg_attr(stage0, lang = "slice")]
#[cfg_attr(not(stage0), lang = "slice_alloc")]
#[lang = "slice_alloc"]
#[cfg(not(test))]
impl<T> [T] {
#[cfg(stage0)]
slice_core_methods!();

/// Sorts the slice.
///
/// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case.
Expand Down Expand Up @@ -467,8 +462,7 @@ impl<T> [T] {
}
}

#[cfg_attr(stage0, lang = "slice_u8")]
#[cfg_attr(not(stage0), lang = "slice_u8_alloc")]
#[lang = "slice_u8_alloc"]
#[cfg(not(test))]
impl [u8] {
/// Returns a vector containing a copy of this slice where each byte
Expand Down Expand Up @@ -504,9 +498,6 @@ impl [u8] {
me.make_ascii_lowercase();
me
}

#[cfg(stage0)]
slice_u8_core_methods!();
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 1 addition & 6 deletions src/liballoc/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

use core::fmt;
use core::str as core_str;
#[cfg(stage0)] use core::str::StrExt;
use core::str::pattern::Pattern;
use core::str::pattern::{Searcher, ReverseSearcher, DoubleEndedSearcher};
use core::mem;
Expand Down Expand Up @@ -158,13 +157,9 @@ impl ToOwned for str {
}

/// Methods for string slices.
#[cfg_attr(stage0, lang = "str")]
#[cfg_attr(not(stage0), lang = "str_alloc")]
#[lang = "str_alloc"]
#[cfg(not(test))]
impl str {
#[cfg(stage0)]
str_core_methods!();

/// Converts a `Box<str>` into a `Box<[u8]>` without copying or allocating.
///
/// # Examples
Expand Down
3 changes: 0 additions & 3 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ use core::intrinsics::{arith_offset, assume};
use core::iter::{FromIterator, FusedIterator, TrustedLen};
use core::marker::PhantomData;
use core::mem;
#[cfg(not(test))]
#[cfg(stage0)]
use core::num::Float;
use core::ops::Bound::{Excluded, Included, Unbounded};
use core::ops::{Index, IndexMut, RangeBounds};
use core::ops;
Expand Down
7 changes: 0 additions & 7 deletions src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ mod contents {
ptr
}

#[cfg(stage0)]
#[no_mangle]
#[rustc_std_internal_symbol]
pub unsafe extern fn __rde_oom() -> ! {
::core::intrinsics::abort();
}

#[no_mangle]
#[rustc_std_internal_symbol]
pub unsafe extern fn __rde_dealloc(ptr: *mut u8,
Expand Down
27 changes: 0 additions & 27 deletions src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,6 @@ unsafe impl Alloc for System {
}
}

#[cfg(stage0)]
#[unstable(feature = "allocator_api", issue = "32838")]
unsafe impl<'a> Alloc for &'a System {
#[inline]
unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<Opaque>, AllocErr> {
NonNull::new(GlobalAlloc::alloc(*self, layout)).ok_or(AllocErr)
}

#[inline]
unsafe fn alloc_zeroed(&mut self, layout: Layout) -> Result<NonNull<Opaque>, AllocErr> {
NonNull::new(GlobalAlloc::alloc_zeroed(*self, layout)).ok_or(AllocErr)
}

#[inline]
unsafe fn dealloc(&mut self, ptr: NonNull<Opaque>, layout: Layout) {
GlobalAlloc::dealloc(*self, ptr.as_ptr(), layout)
}

#[inline]
unsafe fn realloc(&mut self,
ptr: NonNull<Opaque>,
layout: Layout,
new_size: usize) -> Result<NonNull<Opaque>, AllocErr> {
NonNull::new(GlobalAlloc::realloc(*self, ptr.as_ptr(), layout, new_size)).ok_or(AllocErr)
}
}

#[cfg(any(windows, unix, target_os = "cloudabi", target_os = "redox"))]
mod realloc_fallback {
use core::alloc::{GlobalAlloc, Opaque, Layout};
Expand Down
1 change: 0 additions & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#![feature(alloc)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
#![cfg_attr(stage0, feature(generic_param_attrs))]
#![cfg_attr(test, feature(test))]

#![allow(deprecated)]
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
authors = ["The Rust Project Developers"]
name = "core"
version = "0.0.0"
autotests = false
autobenches = false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with alloc I'm not sure about this, but it felt right...


[lib]
name = "core"
Expand Down
1 change: 0 additions & 1 deletion src/libcore/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ pub struct AssertParamIsCopy<T: Copy + ?Sized> { _field: ::marker::PhantomData<T
///
/// Implementations that cannot be described in Rust
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
#[cfg(not(stage0))]
mod impls {

use super::Clone;
Expand Down
14 changes: 0 additions & 14 deletions src/libcore/internal_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,3 @@ macro_rules! forward_ref_op_assign {
}
}
}

#[cfg(stage0)]
macro_rules! public_in_stage0 {
( { $(#[$attr:meta])* } $($Item: tt)*) => {
$(#[$attr])* pub $($Item)*
}
}

#[cfg(not(stage0))]
macro_rules! public_in_stage0 {
( { $(#[$attr:meta])* } $($Item: tt)*) => {
$(#[$attr])* pub(crate) $($Item)*
}
}
19 changes: 7 additions & 12 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,13 @@
#![feature(unwind_attributes)]
#![feature(doc_alias)]
#![feature(inclusive_range_methods)]

#![cfg_attr(not(stage0), feature(mmx_target_feature))]
#![cfg_attr(not(stage0), feature(tbm_target_feature))]
#![cfg_attr(not(stage0), feature(sse4a_target_feature))]
#![cfg_attr(not(stage0), feature(arm_target_feature))]
#![cfg_attr(not(stage0), feature(powerpc_target_feature))]
#![cfg_attr(not(stage0), feature(mips_target_feature))]
#![cfg_attr(not(stage0), feature(aarch64_target_feature))]

#![cfg_attr(stage0, feature(target_feature))]
#![cfg_attr(stage0, feature(cfg_target_feature))]
#![cfg_attr(stage0, feature(fn_must_use))]
#![feature(mmx_target_feature)]
#![feature(tbm_target_feature)]
#![feature(sse4a_target_feature)]
#![feature(arm_target_feature)]
#![feature(powerpc_target_feature)]
#![feature(mips_target_feature)]
#![feature(aarch64_target_feature)]

#[prelude_import]
#[allow(unused)]
Expand Down
1 change: 0 additions & 1 deletion src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ pub unsafe auto trait Unpin {}
///
/// Implementations that cannot be described in Rust
/// are implemented in `SelectionContext::copy_clone_conditions()` in librustc.
#[cfg(not(stage0))]
mod copy_impls {

use super::Copy;
Expand Down
Loading