Skip to content

Commit 89bd3f3

Browse files
committed
Update #[no_core] users with the "freeze" lang item.
1 parent 0adfd81 commit 89bd3f3

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

src/bootstrap/compile.rs

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

src/rtstartup/rsbegin.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// object (usually called `crtX.o), which then invokes initialization callbacks
2323
// of other runtime components (registered via yet another special image section).
2424

25-
#![feature(no_core, lang_items)]
25+
#![feature(no_core, lang_items, optin_builtin_traits)]
2626
#![crate_type="rlib"]
2727
#![no_core]
2828
#![allow(non_camel_case_types)]
@@ -31,9 +31,12 @@
3131
trait Sized {}
3232
#[lang = "sync"]
3333
trait Sync {}
34+
impl Sync for .. {}
3435
#[lang = "copy"]
3536
trait Copy {}
36-
impl<T> Sync for T {}
37+
#[cfg_attr(not(stage0), lang = "freeze")]
38+
trait Freeze {}
39+
impl Freeze for .. {}
3740

3841
#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
3942
pub mod eh_frames {

src/test/run-make/simd-ffi/simd.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#![crate_type = "lib"]
1313
// we can compile to a variety of platforms, because we don't need
1414
// cross-compiled standard libraries.
15-
#![feature(no_core)]
15+
#![feature(no_core, optin_builtin_traits)]
1616
#![no_core]
1717

1818
#![feature(repr_simd, simd_ffi, link_llvm_intrinsics, lang_items)]
@@ -78,3 +78,7 @@ pub trait Copy { }
7878
pub mod marker {
7979
pub use Copy;
8080
}
81+
82+
#[lang = "freeze"]
83+
trait Freeze {}
84+
impl Freeze for .. {}

src/test/run-make/target-specs/foo.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(lang_items, no_core)]
11+
#![feature(lang_items, no_core, optin_builtin_traits)]
1212
#![no_core]
1313

1414
#[lang="copy"]
@@ -17,6 +17,10 @@ trait Copy { }
1717
#[lang="sized"]
1818
trait Sized { }
1919

20+
#[lang = "freeze"]
21+
trait Freeze {}
22+
impl Freeze for .. {}
23+
2024
#[lang="start"]
2125
fn start(_main: *const u8, _argc: isize, _argv: *const *const u8) -> isize { 0 }
2226

0 commit comments

Comments
 (0)