Skip to content

Commit c1b187d

Browse files
committed
auto merge of #9454 : alexcrichton/rust/snapshot, r=thestinger
2 parents d062de8 + 51cfcc8 commit c1b187d

File tree

9 files changed

+13
-91
lines changed

9 files changed

+13
-91
lines changed

src/libstd/rt/crate_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use container::MutableSet;
2323
#[link_args = "-undefined dynamic_lookup"]
2424
extern {}
2525

26-
#[cfg(not(stage0), not(windows))]
26+
#[cfg(not(windows))]
2727
extern {
2828
#[weak_linkage]
2929
#[link_name = "_rust_crate_map_toplevel"]
@@ -48,12 +48,12 @@ struct CrateMap {
4848
children: [*CrateMap, ..1]
4949
}
5050

51-
#[cfg(not(stage0), not(windows))]
51+
#[cfg(not(windows))]
5252
pub fn get_crate_map() -> *CrateMap {
5353
&'static CRATE_MAP as *CrateMap
5454
}
5555

56-
#[cfg(not(stage0), windows)]
56+
#[cfg(windows)]
5757
#[fixed_stack_segment]
5858
#[inline(never)]
5959
pub fn get_crate_map() -> *CrateMap {

src/libstd/rt/logging.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use libc::{uintptr_t, exit, STDERR_FILENO};
1212
use option::{Some, None, Option};
1313
use rt::util::dumb_println;
1414
use rt::crate_map::{ModEntry, iter_crate_map};
15-
#[cfg(not(stage0))] use rt::crate_map::get_crate_map;
15+
use rt::crate_map::get_crate_map;
1616
use str::StrSlice;
1717
use str::raw::from_c_str;
1818
use u32;
@@ -211,22 +211,6 @@ impl Logger for StdErrLogger {
211211
}
212212
/// Configure logging by traversing the crate map and setting the
213213
/// per-module global logging flags based on the logging spec
214-
#[fixed_stack_segment] #[inline(never)]
215-
#[cfg(stage0)]
216-
pub fn init(crate_map: *u8) {
217-
use os;
218-
219-
let log_spec = os::getenv("RUST_LOG");
220-
match log_spec {
221-
Some(spec) => {
222-
update_log_settings(crate_map, spec);
223-
}
224-
None => {
225-
update_log_settings(crate_map, ~"");
226-
}
227-
}
228-
}
229-
#[cfg(not(stage0))]
230214
pub fn init() {
231215
use os;
232216

src/libstd/rt/mod.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,6 @@ pub mod borrowck;
176176
/// # Return value
177177
///
178178
/// The return value is used as the process return code. 0 on success, 101 on error.
179-
#[cfg(stage0)]
180-
pub fn start(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int {
181-
182-
init(argc, argv, crate_map);
183-
let exit_code = run(main);
184-
cleanup();
185-
186-
return exit_code;
187-
}
188-
#[cfg(not(stage0))]
189179
pub fn start(argc: int, argv: **u8, main: ~fn()) -> int {
190180

191181
init(argc, argv);
@@ -200,15 +190,6 @@ pub fn start(argc: int, argv: **u8, main: ~fn()) -> int {
200190
///
201191
/// This is appropriate for running code that must execute on the main thread,
202192
/// such as the platform event loop and GUI.
203-
#[cfg(stage0)]
204-
pub fn start_on_main_thread(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int {
205-
init(argc, argv, crate_map);
206-
let exit_code = run_on_main_thread(main);
207-
cleanup();
208-
209-
return exit_code;
210-
}
211-
#[cfg(not(stage0))]
212193
pub fn start_on_main_thread(argc: int, argv: **u8, main: ~fn()) -> int {
213194
init(argc, argv);
214195
let exit_code = run_on_main_thread(main);
@@ -222,17 +203,6 @@ pub fn start_on_main_thread(argc: int, argv: **u8, main: ~fn()) -> int {
222203
/// Initializes global state, including frobbing
223204
/// the crate's logging flags, registering GC
224205
/// metadata, and storing the process arguments.
225-
#[cfg(stage0)]
226-
pub fn init(argc: int, argv: **u8, crate_map: *u8) {
227-
// XXX: Derefing these pointers is not safe.
228-
// Need to propagate the unsafety to `start`.
229-
unsafe {
230-
args::init(argc, argv);
231-
env::init();
232-
logging::init(crate_map);
233-
}
234-
}
235-
#[cfg(not(stage0))]
236206
pub fn init(argc: int, argv: **u8) {
237207
// XXX: Derefing these pointers is not safe.
238208
// Need to propagate the unsafety to `start`.

src/libstd/unstable/lang.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,6 @@ pub unsafe fn check_not_borrowed(a: *u8,
9393
borrowck::check_not_borrowed(a, file, line)
9494
}
9595

96-
#[cfg(stage0)]
97-
#[lang="start"]
98-
pub fn start(main: *u8, argc: int, argv: **c_char,
99-
crate_map: *u8) -> int {
100-
use rt;
101-
102-
unsafe {
103-
return do rt::start(argc, argv as **u8, crate_map) {
104-
let main: extern "Rust" fn() = transmute(main);
105-
main();
106-
};
107-
}
108-
}
109-
110-
#[cfg(not(stage0))]
11196
#[lang="start"]
11297
pub fn start(main: *u8, argc: int, argv: **c_char) -> int {
11398
use rt;

src/snapshots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2013-09-23 348d844
2+
freebsd-x86_64 8b99ec197e441f013c5ba0788f8bcfa689bfc75e
3+
linux-i386 9a237fcbe4d29986a360b1dc8984da3b946463e6
4+
linux-x86_64 47906010eb676cbf9e0caa0773d9ef2dce89e9f8
5+
macos-i386 7085e4dd6bc63864f2ad8a3a21dab945ffd99d8d
6+
macos-x86_64 efefdca6b4a40ebeb977037ebbf46c1353f09ee5
7+
winnt-i386 7988b58a9530a4ac0688ec978e9124c5db56717c
8+
19
S 2013-09-17 cbd1eef
210
freebsd-x86_64 9166867a8859076343cb3e57da918b5c0eea720b
311
linux-i386 38347b579312ff30c36d257a1161660eb0ae8422

src/test/run-pass/attr-start.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
//xfail-fast
1212

1313
#[start]
14-
#[cfg(stage0)]
15-
fn start(_argc: int, _argv: **u8, _crate_map: *u8) -> int {
16-
return 0;
17-
}
18-
#[start]
19-
#[cfg(not(stage0))]
2014
fn start(_argc: int, _argv: **u8) -> int {
2115
return 0;
2216
}

src/test/run-pass/core-rt-smoke.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313
// A simple test of starting the runtime manually
1414

1515
#[start]
16-
#[cfg(stage0)]
17-
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
18-
do std::rt::start(argc, argv, crate_map) {
19-
info!("creating my own runtime is joy");
20-
}
21-
}
22-
#[start]
23-
#[cfg(not(stage0))]
2416
fn start(argc: int, argv: **u8) -> int {
2517
do std::rt::start(argc, argv) {
2618
info!("creating my own runtime is joy");

src/test/run-pass/generic-tag-corruption.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
// This causes memory corruption in stage0.
14+
// This used to cause memory corruption in stage 0.
1515
enum thing<K> { some(K), }
1616

1717
pub fn main() { let _x = some(~"hi"); }

src/test/run-pass/rt-start-main-thread.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@
1111
// xfail-fast
1212

1313
#[start]
14-
#[cfg(stage0)]
15-
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
16-
do std::rt::start_on_main_thread(argc, argv, crate_map) {
17-
info!("running on main thread");
18-
do spawn {
19-
info!("running on another thread");
20-
}
21-
}
22-
}
23-
#[start]
24-
#[cfg(not(stage0))]
2514
fn start(argc: int, argv: **u8) -> int {
2615
do std::rt::start_on_main_thread(argc, argv) {
2716
info!("running on main thread");

0 commit comments

Comments
 (0)