Skip to content

Commit fce605e

Browse files
committed
Remove old stage0 compatibility
1 parent ab6ca7e commit fce605e

File tree

5 files changed

+29
-90
lines changed

5 files changed

+29
-90
lines changed

src/libcore/cmp.rs

+18-27
Original file line numberDiff line numberDiff line change
@@ -699,38 +699,29 @@ mod impls {
699699

700700
ord_impl! { char usize u8 u16 u32 u64 isize i8 i16 i32 i64 }
701701

702-
// Note: This macro is a temporary hack that can be remove once we are building with a compiler
703-
// that supports `!`
704-
macro_rules! not_stage0 {
705-
() => {
706-
#[unstable(feature = "never_type", issue = "35121")]
707-
impl PartialEq for ! {
708-
fn eq(&self, _: &!) -> bool {
709-
*self
710-
}
711-
}
702+
#[unstable(feature = "never_type", issue = "35121")]
703+
impl PartialEq for ! {
704+
fn eq(&self, _: &!) -> bool {
705+
*self
706+
}
707+
}
712708

713-
#[unstable(feature = "never_type", issue = "35121")]
714-
impl Eq for ! {}
709+
#[unstable(feature = "never_type", issue = "35121")]
710+
impl Eq for ! {}
715711

716-
#[unstable(feature = "never_type", issue = "35121")]
717-
impl PartialOrd for ! {
718-
fn partial_cmp(&self, _: &!) -> Option<Ordering> {
719-
*self
720-
}
721-
}
722-
723-
#[unstable(feature = "never_type", issue = "35121")]
724-
impl Ord for ! {
725-
fn cmp(&self, _: &!) -> Ordering {
726-
*self
727-
}
728-
}
712+
#[unstable(feature = "never_type", issue = "35121")]
713+
impl PartialOrd for ! {
714+
fn partial_cmp(&self, _: &!) -> Option<Ordering> {
715+
*self
729716
}
730717
}
731718

732-
#[cfg(not(stage0))]
733-
not_stage0!();
719+
#[unstable(feature = "never_type", issue = "35121")]
720+
impl Ord for ! {
721+
fn cmp(&self, _: &!) -> Ordering {
722+
*self
723+
}
724+
}
734725

735726
// & pointers
736727

src/libcore/fmt/mod.rs

+10-19
Original file line numberDiff line numberDiff line change
@@ -1363,28 +1363,19 @@ macro_rules! fmt_refs {
13631363

13641364
fmt_refs! { Debug, Display, Octal, Binary, LowerHex, UpperHex, LowerExp, UpperExp }
13651365

1366-
// Note: This macro is a temporary hack that can be remove once we are building with a compiler
1367-
// that supports `!`
1368-
macro_rules! not_stage0 {
1369-
() => {
1370-
#[unstable(feature = "never_type", issue = "35121")]
1371-
impl Debug for ! {
1372-
fn fmt(&self, _: &mut Formatter) -> Result {
1373-
*self
1374-
}
1375-
}
1376-
1377-
#[unstable(feature = "never_type", issue = "35121")]
1378-
impl Display for ! {
1379-
fn fmt(&self, _: &mut Formatter) -> Result {
1380-
*self
1381-
}
1382-
}
1366+
#[unstable(feature = "never_type", issue = "35121")]
1367+
impl Debug for ! {
1368+
fn fmt(&self, _: &mut Formatter) -> Result {
1369+
*self
13831370
}
13841371
}
13851372

1386-
#[cfg(not(stage0))]
1387-
not_stage0!();
1373+
#[unstable(feature = "never_type", issue = "35121")]
1374+
impl Display for ! {
1375+
fn fmt(&self, _: &mut Formatter) -> Result {
1376+
*self
1377+
}
1378+
}
13881379

13891380
#[stable(feature = "rust1", since = "1.0.0")]
13901381
impl Debug for bool {

src/libcore/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
#![deny(missing_debug_implementations)]
6868
#![cfg_attr(not(stage0), deny(warnings))]
6969

70-
#![cfg_attr(stage0, allow(unused_attributes))]
71-
7270
#![feature(allow_internal_unstable)]
7371
#![feature(asm)]
7472
#![feature(associated_type_defaults)]
@@ -92,9 +90,7 @@
9290
#![feature(staged_api)]
9391
#![feature(unboxed_closures)]
9492
#![feature(question_mark)]
95-
96-
// NOTE: remove the cfg_attr next snapshot
97-
#![cfg_attr(not(stage0), feature(never_type))]
93+
#![feature(never_type)]
9894

9995
#[macro_use]
10096
mod macros;

src/libpanic_unwind/gcc.rs

-24
Original file line numberDiff line numberDiff line change
@@ -264,30 +264,6 @@ unsafe fn find_eh_action(context: *mut uw::_Unwind_Context) -> EHAction {
264264
eh::find_eh_action(lsda, &eh_context)
265265
}
266266

267-
// *** Delete after a new snapshot ***
268-
#[cfg(all(stage0, any(target_os = "ios", not(target_arch = "arm"))))]
269-
#[lang = "eh_personality_catch"]
270-
#[no_mangle]
271-
pub unsafe extern "C" fn rust_eh_personality_catch(version: c_int,
272-
actions: uw::_Unwind_Action,
273-
exception_class: uw::_Unwind_Exception_Class,
274-
ue_header: *mut uw::_Unwind_Exception,
275-
context: *mut uw::_Unwind_Context)
276-
-> uw::_Unwind_Reason_Code {
277-
rust_eh_personality(version, actions, exception_class, ue_header, context)
278-
}
279-
280-
// *** Delete after a new snapshot ***
281-
#[cfg(all(stage0, target_arch = "arm", not(target_os = "ios")))]
282-
#[lang = "eh_personality_catch"]
283-
#[no_mangle]
284-
pub unsafe extern "C" fn rust_eh_personality_catch(state: uw::_Unwind_State,
285-
ue_header: *mut uw::_Unwind_Exception,
286-
context: *mut uw::_Unwind_Context)
287-
-> uw::_Unwind_Reason_Code {
288-
rust_eh_personality(state, ue_header, context)
289-
}
290-
291267
// See docs in the `unwind` module.
292268
#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
293269
#[lang = "eh_unwind_resume"]

src/libpanic_unwind/seh64_gnu.rs

-15
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,6 @@ pub unsafe fn cleanup(ptr: *mut u8) -> Box<Any + Send> {
8181
// This is considered acceptable, because the behavior of throwing exceptions
8282
// through a C ABI boundary is undefined.
8383

84-
// *** Delete after a new snapshot ***
85-
#[cfg(stage0)]
86-
#[lang = "eh_personality_catch"]
87-
#[cfg(not(test))]
88-
unsafe extern "C" fn rust_eh_personality_catch(exceptionRecord: *mut c::EXCEPTION_RECORD,
89-
establisherFrame: c::LPVOID,
90-
contextRecord: *mut c::CONTEXT,
91-
dispatcherContext: *mut c::DISPATCHER_CONTEXT)
92-
-> c::EXCEPTION_DISPOSITION {
93-
rust_eh_personality(exceptionRecord,
94-
establisherFrame,
95-
contextRecord,
96-
dispatcherContext)
97-
}
98-
9984
#[lang = "eh_personality"]
10085
#[cfg(not(test))]
10186
unsafe extern "C" fn rust_eh_personality(exceptionRecord: *mut c::EXCEPTION_RECORD,

0 commit comments

Comments
 (0)