1
Fork 0

Update #[no_core] users with the "freeze" lang item.

This commit is contained in:
Eduard-Mihai Burtescu 2017-04-18 11:02:21 +03:00
parent 0adfd810f8
commit 89bd3f39ca
4 changed files with 16 additions and 4 deletions

View file

@ -151,6 +151,7 @@ pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &st
if !up_to_date(src_file, dst_file) { if !up_to_date(src_file, dst_file) {
let mut cmd = Command::new(&compiler_path); let mut cmd = Command::new(&compiler_path);
build.run(cmd.env("RUSTC_BOOTSTRAP", "1") build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
.arg("--cfg").arg(format!("stage{}", compiler.stage))
.arg("--target").arg(target) .arg("--target").arg(target)
.arg("--emit=obj") .arg("--emit=obj")
.arg("--out-dir").arg(dst_dir) .arg("--out-dir").arg(dst_dir)

View file

@ -22,7 +22,7 @@
// object (usually called `crtX.o), which then invokes initialization callbacks // object (usually called `crtX.o), which then invokes initialization callbacks
// of other runtime components (registered via yet another special image section). // of other runtime components (registered via yet another special image section).
#![feature(no_core, lang_items)] #![feature(no_core, lang_items, optin_builtin_traits)]
#![crate_type="rlib"] #![crate_type="rlib"]
#![no_core] #![no_core]
#![allow(non_camel_case_types)] #![allow(non_camel_case_types)]
@ -31,9 +31,12 @@
trait Sized {} trait Sized {}
#[lang = "sync"] #[lang = "sync"]
trait Sync {} trait Sync {}
impl Sync for .. {}
#[lang = "copy"] #[lang = "copy"]
trait Copy {} trait Copy {}
impl<T> Sync for T {} #[cfg_attr(not(stage0), lang = "freeze")]
trait Freeze {}
impl Freeze for .. {}
#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))] #[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
pub mod eh_frames { pub mod eh_frames {

View file

@ -12,7 +12,7 @@
#![crate_type = "lib"] #![crate_type = "lib"]
// we can compile to a variety of platforms, because we don't need // we can compile to a variety of platforms, because we don't need
// cross-compiled standard libraries. // cross-compiled standard libraries.
#![feature(no_core)] #![feature(no_core, optin_builtin_traits)]
#![no_core] #![no_core]
#![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items)] #![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items)]
@ -78,3 +78,7 @@ pub trait Copy { }
pub mod marker { pub mod marker {
pub use Copy; pub use Copy;
} }
#[lang = "freeze"]
trait Freeze {}
impl Freeze for .. {}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(lang_items, no_core)] #![feature(lang_items, no_core, optin_builtin_traits)]
#![no_core] #![no_core]
#[lang="copy"] #[lang="copy"]
@ -17,6 +17,10 @@ trait Copy { }
#[lang="sized"] #[lang="sized"]
trait Sized { } trait Sized { }
#[lang = "freeze"]
trait Freeze {}
impl Freeze for .. {}
#[lang="start"] #[lang="start"]
fn start(_main: *const u8, _argc: isize, _argv: *const *const u8) -> isize { 0 } fn start(_main: *const u8, _argc: isize, _argv: *const *const u8) -> isize { 0 }