Skip to content

Commit ffb2f12

Browse files
author
Keegan McAllister
committed
Use phase(plugin) in bootstrap crates
Do this to avoid warnings on post-stage0 builds.
1 parent 6d15c67 commit ffb2f12

File tree

15 files changed

+98
-18
lines changed

15 files changed

+98
-18
lines changed

src/compiletest/compiletest.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@
1818

1919
extern crate test;
2020
extern crate getopts;
21-
#[phase(link, syntax)]
22-
extern crate log;
2321
extern crate green;
2422
extern crate rustuv;
2523

24+
#[cfg(stage0)]
25+
#[phase(syntax, link)]
26+
extern crate log;
27+
28+
#[cfg(not(stage0))]
29+
#[phase(plugin, link)]
30+
extern crate log;
31+
2632
extern crate regex;
2733

2834
use std::os;

src/liballoc/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,14 @@
7070
#![no_std]
7171
#![feature(phase)]
7272

73+
#[cfg(stage0)]
7374
#[phase(syntax, link)]
7475
extern crate core;
76+
77+
#[cfg(not(stage0))]
78+
#[phase(plugin, link)]
79+
extern crate core;
80+
7581
extern crate libc;
7682

7783

@@ -80,8 +86,10 @@ extern crate libc;
8086
#[cfg(test)] extern crate debug;
8187
#[cfg(test)] extern crate sync;
8288
#[cfg(test)] extern crate native;
83-
#[cfg(test)] #[phase(syntax, link)] extern crate std;
84-
#[cfg(test)] #[phase(syntax, link)] extern crate log;
89+
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
90+
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
91+
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
92+
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
8593

8694
// Heaps provided for low-level allocation strategies
8795

src/libcollections/lib.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,24 @@
2323
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
2424
#![no_std]
2525

26-
#[phase(syntax, link)] extern crate core;
2726
extern crate alloc;
2827

28+
#[cfg(stage0)]
29+
#[phase(syntax, link)]
30+
extern crate core;
31+
32+
#[cfg(not(stage0))]
33+
#[phase(plugin, link)]
34+
extern crate core;
35+
2936
#[cfg(test)] extern crate native;
3037
#[cfg(test)] extern crate test;
3138
#[cfg(test)] extern crate debug;
32-
#[cfg(test)] #[phase(syntax, link)] extern crate std;
33-
#[cfg(test)] #[phase(syntax, link)] extern crate log;
39+
40+
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
41+
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
42+
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
43+
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
3444

3545
use core::prelude::*;
3646

src/libflate/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Simple [DEFLATE][def]-based compression. This is a wrapper around the
2828
#![feature(phase)]
2929
#![deny(deprecated_owned_vector)]
3030

31-
#[cfg(test)] #[phase(syntax, link)] extern crate log;
31+
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
32+
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
3233

3334
extern crate libc;
3435

src/libgetopts/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@
9191
#![deny(deprecated_owned_vector)]
9292

9393
#[cfg(test)] extern crate debug;
94-
#[cfg(test)] #[phase(syntax, link)] extern crate log;
94+
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
95+
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
9596

9697
use std::cmp::PartialEq;
9798
use std::result::{Err, Ok};

src/librand/lib.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,28 @@
2828
#![no_std]
2929
#![experimental]
3030

31+
#[cfg(stage0)]
3132
#[phase(syntax, link)]
3233
extern crate core;
3334

35+
#[cfg(not(stage0))]
36+
#[phase(plugin, link)]
37+
extern crate core;
38+
39+
#[cfg(test, stage0)]
40+
#[phase(syntax, link)] extern crate std;
41+
42+
#[cfg(test, stage0)]
43+
#[phase(syntax, link)] extern crate log;
44+
45+
#[cfg(test, not(stage0))]
46+
#[phase(plugin, link)] extern crate std;
47+
48+
#[cfg(test, not(stage0))]
49+
#[phase(plugin, link)] extern crate log;
50+
3451
#[cfg(test)] extern crate native;
3552
#[cfg(test)] extern crate debug;
36-
#[cfg(test)] #[phase(syntax, link)] extern crate std;
37-
#[cfg(test)] #[phase(syntax, link)] extern crate log;
3853

3954
use core::prelude::*;
4055

src/librustc/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ extern crate sync;
4242
extern crate syntax;
4343
extern crate time;
4444

45+
#[cfg(stage0)]
4546
#[phase(syntax, link)]
4647
extern crate log;
4748

49+
#[cfg(not(stage0))]
50+
#[phase(plugin, link)]
51+
extern crate log;
52+
4853
pub mod middle {
4954
pub mod def;
5055
pub mod trans;

src/librustdoc/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,21 @@
1919
extern crate debug;
2020
extern crate getopts;
2121
extern crate libc;
22-
#[phase(syntax, link)]
23-
extern crate log;
2422
extern crate rustc;
2523
extern crate serialize;
2624
extern crate sync;
2725
extern crate syntax;
2826
extern crate testing = "test";
2927
extern crate time;
3028

29+
#[cfg(stage0)]
30+
#[phase(syntax, link)]
31+
extern crate log;
32+
33+
#[cfg(not(stage0))]
34+
#[phase(plugin, link)]
35+
extern crate log;
36+
3137
use std::io;
3238
use std::io::{File, MemWriter};
3339
use std::str;

src/librustrt/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,24 @@
1919
#![no_std]
2020
#![experimental]
2121

22+
#[cfg(stage0)]
2223
#[phase(syntax, link)]
2324
extern crate core;
25+
26+
#[cfg(not(stage0))]
27+
#[phase(plugin, link)]
28+
extern crate core;
29+
2430
extern crate alloc;
2531
extern crate libc;
2632
extern crate collections;
2733

2834
#[cfg(test)] extern crate realrustrt = "rustrt";
2935
#[cfg(test)] extern crate test;
3036
#[cfg(test)] extern crate native;
31-
#[cfg(test)] #[phase(syntax, link)] extern crate std;
37+
38+
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
39+
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
3240

3341
pub use self::util::{Stdio, Stdout, Stderr};
3442
pub use self::unwind::{begin_unwind, begin_unwind_fmt};

src/libserialize/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,15 @@ Core encoding and decoding interfaces.
2727
// test harness access
2828
#[cfg(test)]
2929
extern crate test;
30+
31+
#[cfg(stage0)]
3032
#[phase(syntax, link)]
3133
extern crate log;
3234

35+
#[cfg(not(stage0))]
36+
#[phase(plugin, link)]
37+
extern crate log;
38+
3339
pub use self::serialize::{Decoder, Encoder, Decodable, Encodable,
3440
DecoderHelpers, EncoderHelpers};
3541

0 commit comments

Comments
 (0)