mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-17 11:05:20 +00:00
auto merge of #9454 : alexcrichton/rust/snapshot, r=thestinger
This commit is contained in:
commit
c1b187d41b
@ -23,7 +23,7 @@ use container::MutableSet;
|
||||
#[link_args = "-undefined dynamic_lookup"]
|
||||
extern {}
|
||||
|
||||
#[cfg(not(stage0), not(windows))]
|
||||
#[cfg(not(windows))]
|
||||
extern {
|
||||
#[weak_linkage]
|
||||
#[link_name = "_rust_crate_map_toplevel"]
|
||||
@ -48,12 +48,12 @@ struct CrateMap {
|
||||
children: [*CrateMap, ..1]
|
||||
}
|
||||
|
||||
#[cfg(not(stage0), not(windows))]
|
||||
#[cfg(not(windows))]
|
||||
pub fn get_crate_map() -> *CrateMap {
|
||||
&'static CRATE_MAP as *CrateMap
|
||||
}
|
||||
|
||||
#[cfg(not(stage0), windows)]
|
||||
#[cfg(windows)]
|
||||
#[fixed_stack_segment]
|
||||
#[inline(never)]
|
||||
pub fn get_crate_map() -> *CrateMap {
|
||||
|
@ -12,7 +12,7 @@ use libc::{uintptr_t, exit, STDERR_FILENO};
|
||||
use option::{Some, None, Option};
|
||||
use rt::util::dumb_println;
|
||||
use rt::crate_map::{ModEntry, iter_crate_map};
|
||||
#[cfg(not(stage0))] use rt::crate_map::get_crate_map;
|
||||
use rt::crate_map::get_crate_map;
|
||||
use str::StrSlice;
|
||||
use str::raw::from_c_str;
|
||||
use u32;
|
||||
@ -211,22 +211,6 @@ impl Logger for StdErrLogger {
|
||||
}
|
||||
/// Configure logging by traversing the crate map and setting the
|
||||
/// per-module global logging flags based on the logging spec
|
||||
#[fixed_stack_segment] #[inline(never)]
|
||||
#[cfg(stage0)]
|
||||
pub fn init(crate_map: *u8) {
|
||||
use os;
|
||||
|
||||
let log_spec = os::getenv("RUST_LOG");
|
||||
match log_spec {
|
||||
Some(spec) => {
|
||||
update_log_settings(crate_map, spec);
|
||||
}
|
||||
None => {
|
||||
update_log_settings(crate_map, ~"");
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn init() {
|
||||
use os;
|
||||
|
||||
|
@ -176,16 +176,6 @@ pub mod borrowck;
|
||||
/// # Return value
|
||||
///
|
||||
/// The return value is used as the process return code. 0 on success, 101 on error.
|
||||
#[cfg(stage0)]
|
||||
pub fn start(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int {
|
||||
|
||||
init(argc, argv, crate_map);
|
||||
let exit_code = run(main);
|
||||
cleanup();
|
||||
|
||||
return exit_code;
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn start(argc: int, argv: **u8, main: ~fn()) -> int {
|
||||
|
||||
init(argc, argv);
|
||||
@ -200,15 +190,6 @@ pub fn start(argc: int, argv: **u8, main: ~fn()) -> int {
|
||||
///
|
||||
/// This is appropriate for running code that must execute on the main thread,
|
||||
/// such as the platform event loop and GUI.
|
||||
#[cfg(stage0)]
|
||||
pub fn start_on_main_thread(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int {
|
||||
init(argc, argv, crate_map);
|
||||
let exit_code = run_on_main_thread(main);
|
||||
cleanup();
|
||||
|
||||
return exit_code;
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn start_on_main_thread(argc: int, argv: **u8, main: ~fn()) -> int {
|
||||
init(argc, argv);
|
||||
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 {
|
||||
/// Initializes global state, including frobbing
|
||||
/// the crate's logging flags, registering GC
|
||||
/// metadata, and storing the process arguments.
|
||||
#[cfg(stage0)]
|
||||
pub fn init(argc: int, argv: **u8, crate_map: *u8) {
|
||||
// XXX: Derefing these pointers is not safe.
|
||||
// Need to propagate the unsafety to `start`.
|
||||
unsafe {
|
||||
args::init(argc, argv);
|
||||
env::init();
|
||||
logging::init(crate_map);
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn init(argc: int, argv: **u8) {
|
||||
// XXX: Derefing these pointers is not safe.
|
||||
// Need to propagate the unsafety to `start`.
|
||||
|
@ -93,21 +93,6 @@ pub unsafe fn check_not_borrowed(a: *u8,
|
||||
borrowck::check_not_borrowed(a, file, line)
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
#[lang="start"]
|
||||
pub fn start(main: *u8, argc: int, argv: **c_char,
|
||||
crate_map: *u8) -> int {
|
||||
use rt;
|
||||
|
||||
unsafe {
|
||||
return do rt::start(argc, argv as **u8, crate_map) {
|
||||
let main: extern "Rust" fn() = transmute(main);
|
||||
main();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
#[lang="start"]
|
||||
pub fn start(main: *u8, argc: int, argv: **c_char) -> int {
|
||||
use rt;
|
||||
|
@ -1,3 +1,11 @@
|
||||
S 2013-09-23 348d844
|
||||
freebsd-x86_64 8b99ec197e441f013c5ba0788f8bcfa689bfc75e
|
||||
linux-i386 9a237fcbe4d29986a360b1dc8984da3b946463e6
|
||||
linux-x86_64 47906010eb676cbf9e0caa0773d9ef2dce89e9f8
|
||||
macos-i386 7085e4dd6bc63864f2ad8a3a21dab945ffd99d8d
|
||||
macos-x86_64 efefdca6b4a40ebeb977037ebbf46c1353f09ee5
|
||||
winnt-i386 7988b58a9530a4ac0688ec978e9124c5db56717c
|
||||
|
||||
S 2013-09-17 cbd1eef
|
||||
freebsd-x86_64 9166867a8859076343cb3e57da918b5c0eea720b
|
||||
linux-i386 38347b579312ff30c36d257a1161660eb0ae8422
|
||||
|
@ -11,12 +11,6 @@
|
||||
//xfail-fast
|
||||
|
||||
#[start]
|
||||
#[cfg(stage0)]
|
||||
fn start(_argc: int, _argv: **u8, _crate_map: *u8) -> int {
|
||||
return 0;
|
||||
}
|
||||
#[start]
|
||||
#[cfg(not(stage0))]
|
||||
fn start(_argc: int, _argv: **u8) -> int {
|
||||
return 0;
|
||||
}
|
||||
|
@ -13,14 +13,6 @@
|
||||
// A simple test of starting the runtime manually
|
||||
|
||||
#[start]
|
||||
#[cfg(stage0)]
|
||||
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
|
||||
do std::rt::start(argc, argv, crate_map) {
|
||||
info!("creating my own runtime is joy");
|
||||
}
|
||||
}
|
||||
#[start]
|
||||
#[cfg(not(stage0))]
|
||||
fn start(argc: int, argv: **u8) -> int {
|
||||
do std::rt::start(argc, argv) {
|
||||
info!("creating my own runtime is joy");
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
|
||||
// This causes memory corruption in stage0.
|
||||
// This used to cause memory corruption in stage 0.
|
||||
enum thing<K> { some(K), }
|
||||
|
||||
pub fn main() { let _x = some(~"hi"); }
|
||||
|
@ -11,17 +11,6 @@
|
||||
// xfail-fast
|
||||
|
||||
#[start]
|
||||
#[cfg(stage0)]
|
||||
fn start(argc: int, argv: **u8, crate_map: *u8) -> int {
|
||||
do std::rt::start_on_main_thread(argc, argv, crate_map) {
|
||||
info!("running on main thread");
|
||||
do spawn {
|
||||
info!("running on another thread");
|
||||
}
|
||||
}
|
||||
}
|
||||
#[start]
|
||||
#[cfg(not(stage0))]
|
||||
fn start(argc: int, argv: **u8) -> int {
|
||||
do std::rt::start_on_main_thread(argc, argv) {
|
||||
info!("running on main thread");
|
||||
|
Loading…
Reference in New Issue
Block a user