Skip to content

Commit

Permalink
Switch to 1.26 bootstrap compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed May 17, 2018
1 parent e315056 commit 9e34324
Show file tree
Hide file tree
Showing 38 changed files with 434 additions and 1,512 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
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: 2 additions & 0 deletions src/liballoc/Cargo.toml
Expand Up @@ -2,6 +2,8 @@
authors = ["The Rust Project Developers"]
name = "alloc"
version = "0.0.0"
autotests = false
autobenches = false

[lib]
name = "alloc"
Expand Down
47 changes: 1 addition & 46 deletions src/liballoc/alloc.rs
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
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
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
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
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
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
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
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
Expand Up @@ -2,6 +2,8 @@
authors = ["The Rust Project Developers"]
name = "core"
version = "0.0.0"
autotests = false
autobenches = false

[lib]
name = "core"
Expand Down
1 change: 0 additions & 1 deletion src/libcore/clone.rs
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
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
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
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
4 changes: 1 addition & 3 deletions src/libcore/num/f32.rs
Expand Up @@ -19,7 +19,7 @@

use mem;
use num::Float;
#[cfg(not(stage0))] use num::FpCategory;
use num::FpCategory;
use num::FpCategory as Fp;

/// The radix or base of the internal representation of `f32`.
Expand Down Expand Up @@ -277,7 +277,6 @@ impl Float for f32 {

// FIXME: remove (inline) this macro and the Float trait
// when updating to a bootstrap compiler that has the new lang items.
#[cfg_attr(stage0, macro_export)]
#[unstable(feature = "core_float", issue = "32110")]
macro_rules! f32_core_methods { () => {
/// Returns `true` if this value is `NaN` and false otherwise.
Expand Down Expand Up @@ -553,7 +552,6 @@ macro_rules! f32_core_methods { () => {

#[lang = "f32"]
#[cfg(not(test))]
#[cfg(not(stage0))]
impl f32 {
f32_core_methods!();
}

0 comments on commit 9e34324

Please sign in to comment.