Skip to content

Commit 3b49c60

Browse files
committed
Remove stage0 hacks
1 parent 6ffb39b commit 3b49c60

File tree

13 files changed

+4
-38
lines changed

13 files changed

+4
-38
lines changed

src/bootstrap/bin/rustc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ fn main() {
104104
let is_panic_abort = args.windows(2).any(|a| {
105105
&*a[0] == "--crate-name" && &*a[1] == "panic_abort"
106106
});
107-
// FIXME(stage0): remove this `stage != "0"` condition
108-
if is_panic_abort && stage != "0" {
107+
if is_panic_abort {
109108
cmd.arg("-C").arg("panic=abort");
110109
}
111110

src/bootstrap/compile.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::process::Command;
2525
use build_helper::output;
2626
use filetime::FileTime;
2727

28-
use util::{exe, staticlib, libdir, mtime, is_dylib, copy};
28+
use util::{exe, libdir, mtime, is_dylib, copy};
2929
use {Build, Compiler, Mode};
3030

3131
/// Build the standard library.
@@ -40,20 +40,6 @@ pub fn std<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
4040
let libdir = build.sysroot_libdir(compiler, target);
4141
let _ = fs::remove_dir_all(&libdir);
4242
t!(fs::create_dir_all(&libdir));
43-
// FIXME(stage0) remove this `if` after the next snapshot
44-
// The stage0 compiler still passes the `-lcompiler-rt` flag to the linker but now `bootstrap`
45-
// never builds a `libcopmiler-rt.a`! We'll fill the hole by simply copying stage0's
46-
// `libcompiler-rt.a` to where the stage1's one is expected (though we could as well just use
47-
// an empty `.a` archive). Note that the symbols of that stage0 `libcompiler-rt.a` won't make
48-
// it to the final binary because now `libcore.rlib` also contains the symbols that
49-
// `libcompiler-rt.a` provides. Since that rlib appears first in the linker arguments, its
50-
// symbols are used instead of `libcompiler-rt.a`'s.
51-
if compiler.stage == 0 {
52-
let rtlib = &staticlib("compiler-rt", target);
53-
let src = build.rustc.parent().unwrap().parent().unwrap().join("lib").join("rustlib")
54-
.join(target).join("lib").join(rtlib);
55-
copy(&src, &libdir.join(rtlib));
56-
}
5743

5844
// Some platforms have startup objects that may be required to produce the
5945
// libstd dynamic library, for example.

src/liballoc/arc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
127127
/// }
128128
/// ```
129129
130-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
131130
#[stable(feature = "rust1", since = "1.0.0")]
132131
pub struct Arc<T: ?Sized> {
133132
ptr: Shared<ArcInner<T>>,
@@ -153,7 +152,6 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
153152
/// nodes behind strong `Arc<T>` pointers, and then storing the parent pointers
154153
/// as `Weak<T>` pointers.
155154
156-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
157155
#[stable(feature = "arc_weak", since = "1.4.0")]
158156
pub struct Weak<T: ?Sized> {
159157
ptr: Shared<ArcInner<T>>,

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
#![feature(staged_api)]
8989
#![feature(unboxed_closures)]
9090
#![feature(unique)]
91-
#![cfg_attr(stage0, feature(unsafe_no_drop_flag))]
9291
#![feature(unsize)]
9392

9493
#![cfg_attr(not(test), feature(fused, fn_traits, placement_new_protocol))]

src/liballoc/raw_vec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use core::cmp;
4444
/// `shrink_to_fit`, and `from_box` will actually set RawVec's private capacity
4545
/// field. This allows zero-sized types to not be special-cased by consumers of
4646
/// this type.
47-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
4847
pub struct RawVec<T> {
4948
ptr: Unique<T>,
5049
cap: usize,

src/liballoc/rc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ struct RcBox<T: ?Sized> {
252252
/// that you have to call them as e.g. `Rc::get_mut(&value)` instead of
253253
/// `value.get_mut()`. This avoids conflicts with methods of the inner
254254
/// type `T`.
255-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
256255
#[stable(feature = "rust1", since = "1.0.0")]
257256
pub struct Rc<T: ?Sized> {
258257
ptr: Shared<RcBox<T>>,
@@ -873,7 +872,6 @@ impl<T> From<T> for Rc<T> {
873872
///
874873
/// [rc]: struct.Rc.html
875874
/// [downgrade]: struct.Rc.html#method.downgrade
876-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
877875
#[stable(feature = "rc_weak", since = "1.4.0")]
878876
pub struct Weak<T: ?Sized> {
879877
ptr: Shared<RcBox<T>>,

src/libcollections/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#![feature(step_by)]
5353
#![feature(unicode)]
5454
#![feature(unique)]
55-
#![cfg_attr(stage0, feature(unsafe_no_drop_flag))]
5655
#![cfg_attr(test, feature(rand, test))]
5756

5857
#![no_std]

src/libcollections/vec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ use super::range::RangeArgument;
268268
/// Vec does not currently guarantee the order in which elements are dropped
269269
/// (the order has changed in the past, and may change again).
270270
///
271-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
272271
#[stable(feature = "rust1", since = "1.0.0")]
273272
pub struct Vec<T> {
274273
buf: RawVec<T>,

src/libcompiler_builtins/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![cfg_attr(not(stage0), feature(compiler_builtins))]
11+
#![feature(compiler_builtins)]
1212
#![no_std]
13-
#![cfg_attr(not(stage0), compiler_builtins)]
13+
#![compiler_builtins]
1414
#![unstable(feature = "compiler_builtins_lib",
1515
reason = "internal implementation detail of rustc right now",
1616
issue = "0")]

src/libcore/clone.rs

-7
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,6 @@ pub struct AssertParamIsClone<T: Clone + ?Sized> { _field: ::marker::PhantomData
129129
reason = "deriving hack, should not be public",
130130
issue = "0")]
131131
pub struct AssertParamIsCopy<T: Copy + ?Sized> { _field: ::marker::PhantomData<T> }
132-
#[cfg(stage0)]
133-
#[doc(hidden)]
134-
#[inline(always)]
135-
#[unstable(feature = "derive_clone_copy",
136-
reason = "deriving hack, should not be public",
137-
issue = "0")]
138-
pub fn assert_receiver_is_clone<T: Clone + ?Sized>(_: &T) {}
139132

140133
#[stable(feature = "rust1", since = "1.0.0")]
141134
impl<'a, T: ?Sized> Clone for &'a T {

src/libcore/intrinsics.rs

-2
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,12 @@ extern "rust-intrinsic" {
194194
/// own, or if it does not enable any significant optimizations.
195195
pub fn assume(b: bool);
196196

197-
#[cfg(not(stage0))]
198197
/// Hints to the compiler that branch condition is likely to be true.
199198
/// Returns the value passed to it.
200199
///
201200
/// Any use other than with `if` statements will probably not have an effect.
202201
pub fn likely(b: bool) -> bool;
203202

204-
#[cfg(not(stage0))]
205203
/// Hints to the compiler that branch condition is likely to be false.
206204
/// Returns the value passed to it.
207205
///

src/libstd/collections/hash/table.rs

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ const EMPTY_BUCKET: u64 = 0;
5959
/// around just the "table" part of the hashtable. It enforces some
6060
/// invariants at the type level and employs some performance trickery,
6161
/// but in general is just a tricked out `Vec<Option<u64, K, V>>`.
62-
#[cfg_attr(stage0, unsafe_no_drop_flag)]
6362
pub struct RawTable<K, V> {
6463
capacity: usize,
6564
size: usize,

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@
278278
#![feature(unboxed_closures)]
279279
#![feature(unicode)]
280280
#![feature(unique)]
281-
#![cfg_attr(stage0, feature(unsafe_no_drop_flag))]
282281
#![feature(unwind_attributes)]
283282
#![feature(vec_push_all)]
284283
#![feature(zero_one)]

0 commit comments

Comments
 (0)