Skip to content

Commit 601eb13

Browse files
committed
Auto merge of #33857 - alexcrichton:new-stage0, r=nikomatsakis
mk: Prepare for a new stage0 compiler This commit prepares the source for a new stage0 compiler, the 1.10.0 beta compiler. These artifacts are hot off the bots and should be ready to go.
2 parents 298730e + fa45670 commit 601eb13

File tree

12 files changed

+32
-80
lines changed

12 files changed

+32
-80
lines changed

src/etc/get-stage0.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def main(argv):
3535
filename = filename_base + '.tar.gz'
3636
url = 'https://static.rust-lang.org/dist/' + date + '/' + filename
3737
dst = dl_dir + '/' + filename
38-
if not os.path.exists(dst):
39-
bootstrap.get(url, dst)
38+
if os.path.exists(dst):
39+
os.unlink(dst)
40+
bootstrap.get(url, dst)
4041

4142
stage0_dst = triple + '/stage0'
4243
if os.path.exists(stage0_dst):

src/libcore/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
// Since libcore defines many fundamental lang items, all tests live in a
4444
// separate crate, libcoretest, to avoid bizarre issues.
4545

46-
#![cfg_attr(stage0, allow(unused_attributes))]
4746
#![crate_name = "core"]
4847
#![stable(feature = "core", since = "1.6.0")]
4948
#![crate_type = "rlib"]

src/libcore/num/int_macros.rs

-18
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@
1010

1111
#![doc(hidden)]
1212

13-
#[cfg(stage0)]
14-
macro_rules! int_module { ($T:ty, $bits:expr) => (
15-
16-
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
17-
// calling the `Bounded::min_value` function.
18-
#[stable(feature = "rust1", since = "1.0.0")]
19-
#[allow(missing_docs)]
20-
pub const MIN: $T = (-1 as $T) << ($bits - 1);
21-
// FIXME(#9837): Compute MIN like this so the high bits that shouldn't exist are 0.
22-
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
23-
// calling the `Bounded::max_value` function.
24-
#[stable(feature = "rust1", since = "1.0.0")]
25-
#[allow(missing_docs)]
26-
pub const MAX: $T = !MIN;
27-
28-
) }
29-
30-
#[cfg(not(stage0))]
3113
macro_rules! int_module { ($T:ident, $bits:expr) => (
3214

3315
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/num/uint_macros.rs

-13
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@
1010

1111
#![doc(hidden)]
1212

13-
#[cfg(stage0)]
14-
macro_rules! uint_module { ($T:ty, $bits:expr) => (
15-
16-
#[stable(feature = "rust1", since = "1.0.0")]
17-
#[allow(missing_docs)]
18-
pub const MIN: $T = 0 as $T;
19-
#[stable(feature = "rust1", since = "1.0.0")]
20-
#[allow(missing_docs)]
21-
pub const MAX: $T = !0 as $T;
22-
23-
) }
24-
25-
#[cfg(not(stage0))]
2613
macro_rules! uint_module { ($T:ident, $bits:expr) => (
2714

2815
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/sync/atomic.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ use default::Default;
8888
use fmt;
8989

9090
/// A boolean type which can be safely shared between threads.
91-
#[cfg(any(stage0, target_has_atomic = "8"))]
91+
#[cfg(target_has_atomic = "8")]
9292
#[stable(feature = "rust1", since = "1.0.0")]
9393
pub struct AtomicBool {
9494
v: UnsafeCell<u8>,
9595
}
9696

97-
#[cfg(any(stage0, target_has_atomic = "8"))]
97+
#[cfg(target_has_atomic = "8")]
9898
#[stable(feature = "rust1", since = "1.0.0")]
9999
impl Default for AtomicBool {
100100
fn default() -> Self {
@@ -103,29 +103,29 @@ impl Default for AtomicBool {
103103
}
104104

105105
// Send is implicitly implemented for AtomicBool.
106-
#[cfg(any(stage0, target_has_atomic = "8"))]
106+
#[cfg(target_has_atomic = "8")]
107107
#[stable(feature = "rust1", since = "1.0.0")]
108108
unsafe impl Sync for AtomicBool {}
109109

110110
/// A raw pointer type which can be safely shared between threads.
111-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
111+
#[cfg(target_has_atomic = "ptr")]
112112
#[stable(feature = "rust1", since = "1.0.0")]
113113
pub struct AtomicPtr<T> {
114114
p: UnsafeCell<*mut T>,
115115
}
116116

117-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
117+
#[cfg(target_has_atomic = "ptr")]
118118
#[stable(feature = "rust1", since = "1.0.0")]
119119
impl<T> Default for AtomicPtr<T> {
120120
fn default() -> AtomicPtr<T> {
121121
AtomicPtr::new(::ptr::null_mut())
122122
}
123123
}
124124

125-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
125+
#[cfg(target_has_atomic = "ptr")]
126126
#[stable(feature = "rust1", since = "1.0.0")]
127127
unsafe impl<T> Send for AtomicPtr<T> {}
128-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
128+
#[cfg(target_has_atomic = "ptr")]
129129
#[stable(feature = "rust1", since = "1.0.0")]
130130
unsafe impl<T> Sync for AtomicPtr<T> {}
131131

@@ -167,11 +167,11 @@ pub enum Ordering {
167167
}
168168

169169
/// An `AtomicBool` initialized to `false`.
170-
#[cfg(any(stage0, target_has_atomic = "8"))]
170+
#[cfg(target_has_atomic = "8")]
171171
#[stable(feature = "rust1", since = "1.0.0")]
172172
pub const ATOMIC_BOOL_INIT: AtomicBool = AtomicBool::new(false);
173173

174-
#[cfg(any(stage0, target_has_atomic = "8"))]
174+
#[cfg(target_has_atomic = "8")]
175175
impl AtomicBool {
176176
/// Creates a new `AtomicBool`.
177177
///
@@ -508,7 +508,7 @@ impl AtomicBool {
508508
}
509509
}
510510

511-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
511+
#[cfg(target_has_atomic = "ptr")]
512512
impl<T> AtomicPtr<T> {
513513
/// Creates a new `AtomicPtr`.
514514
///
@@ -1106,14 +1106,14 @@ atomic_int! {
11061106
unstable(feature = "integer_atomics", issue = "32976"),
11071107
u64 AtomicU64 ATOMIC_U64_INIT
11081108
}
1109-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
1109+
#[cfg(target_has_atomic = "ptr")]
11101110
atomic_int!{
11111111
stable(feature = "rust1", since = "1.0.0"),
11121112
stable(feature = "extended_compare_and_swap", since = "1.10.0"),
11131113
stable(feature = "atomic_debug", since = "1.3.0"),
11141114
isize AtomicIsize ATOMIC_ISIZE_INIT
11151115
}
1116-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
1116+
#[cfg(target_has_atomic = "ptr")]
11171117
atomic_int!{
11181118
stable(feature = "rust1", since = "1.0.0"),
11191119
stable(feature = "extended_compare_and_swap", since = "1.10.0"),
@@ -1311,15 +1311,15 @@ pub fn fence(order: Ordering) {
13111311
}
13121312

13131313

1314-
#[cfg(any(stage0, target_has_atomic = "8"))]
1314+
#[cfg(target_has_atomic = "8")]
13151315
#[stable(feature = "atomic_debug", since = "1.3.0")]
13161316
impl fmt::Debug for AtomicBool {
13171317
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
13181318
f.debug_tuple("AtomicBool").field(&self.load(Ordering::SeqCst)).finish()
13191319
}
13201320
}
13211321

1322-
#[cfg(any(stage0, target_has_atomic = "ptr"))]
1322+
#[cfg(target_has_atomic = "ptr")]
13231323
#[stable(feature = "atomic_debug", since = "1.3.0")]
13241324
impl<T> fmt::Debug for AtomicPtr<T> {
13251325
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/libpanic_abort/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#![feature(staged_api)]
2727

28-
#![cfg_attr(not(stage0), panic_runtime)]
29-
#![cfg_attr(not(stage0), feature(panic_runtime))]
28+
#![panic_runtime]
29+
#![feature(panic_runtime)]
3030
#![cfg_attr(unix, feature(libc))]
3131
#![cfg_attr(windows, feature(core_intrinsics))]
3232

@@ -93,7 +93,6 @@ pub unsafe extern fn __rust_start_panic(_data: usize, _vtable: usize) -> u32 {
9393
// Essentially this symbol is just defined to get wired up to libcore/libstd
9494
// binaries, but it should never be called as we don't link in an unwinding
9595
// runtime at all.
96-
#[cfg(not(stage0))]
9796
pub mod personalities {
9897

9998
#[no_mangle]

src/libpanic_unwind/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
#![feature(unwind_attributes)]
4343
#![cfg_attr(target_env = "msvc", feature(raw))]
4444

45-
#![cfg_attr(not(stage0), panic_runtime)]
46-
#![cfg_attr(not(stage0), feature(panic_runtime))]
45+
#![panic_runtime]
46+
#![feature(panic_runtime)]
4747

4848
extern crate alloc;
4949
extern crate libc;

src/libpanic_unwind/seh.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@ extern {
233233
// an argument to the C++ personality function.
234234
//
235235
// Again, I'm not entirely sure what this is describing, it just seems to work.
236-
#[cfg_attr(all(not(test), not(stage0)),
237-
lang = "msvc_try_filter")]
236+
#[cfg_attr(not(test), lang = "msvc_try_filter")]
238237
static mut TYPE_DESCRIPTOR1: _TypeDescriptor = _TypeDescriptor {
239238
pVFTable: &TYPE_INFO_VTABLE as *const _ as *const _,
240239
spare: 0 as *mut _,
@@ -308,13 +307,6 @@ pub unsafe fn cleanup(payload: [u64; 2]) -> Box<Any + Send> {
308307
})
309308
}
310309

311-
#[lang = "msvc_try_filter"]
312-
#[cfg(stage0)]
313-
unsafe extern fn __rust_try_filter(_eh_ptrs: *mut u8,
314-
_payload: *mut u8) -> i32 {
315-
return 0
316-
}
317-
318310
// This is required by the compiler to exist (e.g. it's a lang item), but
319311
// it's never actually called by the compiler because __C_specific_handler
320312
// or _except_handler3 is the personality function that is always used.

src/libstd/lib.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@
210210
test(no_crate_inject, attr(deny(warnings))),
211211
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
212212

213+
#![needs_panic_runtime]
214+
213215
#![feature(alloc)]
214216
#![feature(allow_internal_unstable)]
215217
#![feature(asm)]
@@ -272,6 +274,7 @@
272274
#![feature(zero_one)]
273275
#![feature(question_mark)]
274276
#![feature(try_from)]
277+
#![feature(needs_panic_runtime)]
275278

276279
// Issue# 30592: Systematically use alloc_system during stage0 since jemalloc
277280
// might be unavailable or disabled
@@ -284,13 +287,6 @@
284287
#![allow(unused_features)] // std may use features in a platform-specific way
285288
#![cfg_attr(not(stage0), deny(warnings))]
286289

287-
// FIXME(stage0): after a snapshot, move needs_panic_runtime up above and remove
288-
// this `extern crate` declaration and feature(panic_unwind)
289-
#![cfg_attr(not(stage0), needs_panic_runtime)]
290-
#![cfg_attr(not(stage0), feature(needs_panic_runtime))]
291-
#[cfg(stage0)]
292-
extern crate panic_unwind as __please_just_link_me_dont_reference_me;
293-
294290
#[cfg(test)] extern crate test;
295291

296292
// We want to reexport a few macros from core but libcore has already been

src/libstd/rt.rs

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
// Reexport some of our utilities which are expected by other crates.
2828
pub use panicking::{begin_panic, begin_panic_fmt};
2929

30-
#[cfg(stage0)]
31-
pub use panicking::begin_panic as begin_unwind;
32-
3330
#[cfg(not(test))]
3431
#[lang = "start"]
3532
fn lang_start(main: *const u8, argc: isize, argv: *const *const u8) -> isize {

src/stage0.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# tarball for a stable release you'll likely see `1.x.0-$date` where `1.x.0` was
1313
# released on `$date`
1414

15-
rustc: beta-2016-04-13
16-
rustc_key: c2743eb4
17-
cargo: nightly-2016-04-10
15+
rustc: beta-2016-05-24
16+
rustc_key: a4922355
17+
cargo: nightly-2016-05-22

src/tools/tidy/src/cargo.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,10 @@ fn verify(tomlfile: &Path, libfile: &Path, bad: &mut bool) {
8181
}
8282

8383
// This is intentional, this dependency just makes the crate available
84-
// for others later on.
85-
if krate == "alloc_jemalloc" && toml.contains("name = \"std\"") {
86-
continue
87-
}
88-
if krate == "panic_abort" && toml.contains("name = \"std\"") {
84+
// for others later on. Cover cases
85+
let whitelisted = krate == "alloc_jemalloc";
86+
let whitelisted = whitelisted || krate.starts_with("panic");
87+
if toml.contains("name = \"std\"") && whitelisted {
8988
continue
9089
}
9190

0 commit comments

Comments
 (0)