Skip to content

Commit 3bc4d1a

Browse files
AatchJames Miller
authored andcommitted
Remove all #[cfg(stage0)]-protected code
New snapshot means this can all go. Also removes places that have comments that say they are workarounds for stage0 errors.
1 parent 6759ce4 commit 3bc4d1a

File tree

20 files changed

+15
-369
lines changed

20 files changed

+15
-369
lines changed

src/libextra/num/complex.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ impl<T: Clone + Num> Cmplx<T> {
8080
}
8181
}
8282

83-
#[cfg(not(stage0))] // Fixed by #4228
8483
impl<T: Clone + Algebraic + Num> Cmplx<T> {
8584
/// Calculate |self|
8685
#[inline]
@@ -89,7 +88,6 @@ impl<T: Clone + Algebraic + Num> Cmplx<T> {
8988
}
9089
}
9190

92-
#[cfg(not(stage0))] // Fixed by #4228
9391
impl<T: Clone + Trigonometric + Algebraic + Num> Cmplx<T> {
9492
/// Calculate the principal Arg of self.
9593
#[inline]

src/libextra/std.rc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,10 @@ Rust extras are part of the standard Rust distribution.
3232
#[deny(non_camel_case_types)];
3333
#[deny(missing_doc)];
3434

35-
// NOTE: remove these two attributes after the next snapshot
36-
#[no_core]; // for stage0
37-
#[allow(unrecognized_lint)]; // otherwise stage0 is seriously ugly
38-
3935
#[no_std];
4036

4137
extern mod core(name = "std", vers = "0.7-pre");
4238

43-
#[cfg(stage0)]
44-
use core::{str, unstable};
4539
use core::str::{StrSlice, OwnedStr};
4640

4741
pub use core::os;

src/libextra/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
275275
let mut i = 0u;
276276
let len = strs.len();
277277
while i < len {
278-
match strs[i] { // can't use let due to stage0 bugs
278+
match strs[i] { // can't use let due to let-pattern bugs
279279
(ref needle, value) => {
280280
if match_str(ss, pos, *needle) {
281281
return Some((value, pos + needle.len()));

src/librustc/back/rpath.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,19 +174,6 @@ pub fn get_absolute_rpath(lib: &Path) -> Path {
174174
os::make_absolute(lib).dir_path()
175175
}
176176

177-
#[cfg(stage0)]
178-
pub fn get_install_prefix_rpath(target_triple: &str) -> Path {
179-
let install_prefix = env!("CFG_PREFIX");
180-
181-
if install_prefix.is_empty() {
182-
fail!("rustc compiled without CFG_PREFIX environment variable");
183-
}
184-
185-
let tlib = filesearch::relative_target_lib_path(target_triple);
186-
os::make_absolute(&Path(install_prefix).push_rel(&tlib))
187-
}
188-
189-
#[cfg(not(stage0))]
190177
pub fn get_install_prefix_rpath(target_triple: &str) -> Path {
191178
let install_prefix = env!("CFG_PREFIX");
192179

src/librustc/driver/driver.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -521,25 +521,6 @@ pub fn build_target_config(sopts: @session::options,
521521
return target_cfg;
522522
}
523523
524-
#[cfg(stage0)]
525-
pub fn host_triple() -> ~str {
526-
// Get the host triple out of the build environment. This ensures that our
527-
// idea of the host triple is the same as for the set of libraries we've
528-
// actually built. We can't just take LLVM's host triple because they
529-
// normalize all ix86 architectures to i386.
530-
//
531-
// Instead of grabbing the host triple (for the current host), we grab (at
532-
// compile time) the target triple that this rustc is built with and
533-
// calling that (at runtime) the host triple.
534-
let ht = env!("CFG_COMPILER_TRIPLE");
535-
return if ht != ~"" {
536-
ht
537-
} else {
538-
fail!("rustc built without CFG_COMPILER_TRIPLE")
539-
};
540-
}
541-
542-
#[cfg(not(stage0))]
543524
pub fn host_triple() -> ~str {
544525
// Get the host triple out of the build environment. This ensures that our
545526
// idea of the host triple is the same as for the set of libraries we've

src/librustc/middle/liveness.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -749,11 +749,7 @@ impl Liveness {
749749
None => {
750750
// Vanilla 'break' or 'loop', so use the enclosing
751751
// loop scope
752-
let len = { // FIXME(#5074) stage0
753-
let loop_scope = &mut *self.loop_scope;
754-
loop_scope.len()
755-
};
756-
if len == 0 {
752+
if self.loop_scope.len() == 0 {
757753
self.tcx.sess.span_bug(sp, "break outside loop");
758754
} else {
759755
// FIXME(#5275): this shouldn't have to be a method...

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ pub fn cleanup_and_leave(bcx: block,
13181318
match cur.kind {
13191319
block_scope(inf) if !inf.empty_cleanups() => {
13201320
let (sub_cx, dest, inf_cleanups) = {
1321-
let inf = &mut *inf; // FIXME(#5074) workaround stage0
1321+
let inf = &mut *inf;
13221322
let mut skip = 0;
13231323
let mut dest = None;
13241324
{

src/librustc/middle/typeck/check/vtable.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,16 +248,9 @@ fn lookup_vtable(vcx: &VtableContext,
248248
// Nothing found. Continue.
249249
}
250250
Some(implementations) => {
251-
let len = { // FIXME(#5074): stage0 requires it
252-
let implementations: &mut ~[@Impl] = *implementations;
253-
implementations.len()
254-
};
255-
256251
// implementations is the list of all impls in scope for
257252
// trait_ref. (Usually, there's just one.)
258-
for uint::range(0, len) |i| {
259-
let im = implementations[i];
260-
253+
for implementations.iter().advance |im| {
261254
// im is one specific impl of trait_ref.
262255

263256
// First, ensure we haven't processed this impl yet.

src/librustc/middle/typeck/coherence.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,8 @@ impl CoherenceChecker {
520520

521521
match extension_methods.find(&trait_def_id) {
522522
Some(impls) => {
523-
let len = { // FIXME(#5074) stage0 requires this
524-
let impls: &mut ~[@Impl] = *impls;
525-
impls.len()
526-
};
527-
for uint::range(0, len) |i| {
528-
f(impls[i]);
523+
for impls.iter().advance |&im| {
524+
f(im);
529525
}
530526
}
531527
None => { /* no impls? */ }

src/librustc/rustc.rc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,8 @@ extern mod core(name = "std");
2828
extern mod extra(name = "extra");
2929
extern mod syntax;
3030

31-
// For deriving(Encodable) purposes...
32-
#[cfg(stage0)]
33-
extern mod std(name = "extra", vers = "0.7-pre");
34-
#[cfg(not(stage0))]
3531
extern mod std(name = "std", vers = "0.7-pre");
3632

37-
// For bootstrapping purposes.
38-
#[cfg(stage0)]
39-
pub use core::unstable;
40-
4133
use core::prelude::*;
4234

4335
use driver::driver::{host_triple, optgroups, early_error};

0 commit comments

Comments
 (0)