From fce605e1f28563b115ad8c18372bd4d8e3b8f1a6 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 18 Aug 2016 17:08:25 +0000 Subject: [PATCH] Remove old stage0 compatibility --- src/libcore/cmp.rs | 49 +++++++++++++------------------- src/libcore/fmt/mod.rs | 29 +++++++------------ src/libcore/lib.rs | 6 +--- src/libpanic_unwind/gcc.rs | 24 ---------------- src/libpanic_unwind/seh64_gnu.rs | 15 ---------- 5 files changed, 31 insertions(+), 92 deletions(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index bb7c9711118..9bba6cd38e5 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -699,38 +699,29 @@ mod impls { ord_impl! { char usize u8 u16 u32 u64 isize i8 i16 i32 i64 } - // Note: This macro is a temporary hack that can be remove once we are building with a compiler - // that supports `!` - macro_rules! not_stage0 { - () => { - #[unstable(feature = "never_type", issue = "35121")] - impl PartialEq for ! { - fn eq(&self, _: &!) -> bool { - *self - } - } - - #[unstable(feature = "never_type", issue = "35121")] - impl Eq for ! {} - - #[unstable(feature = "never_type", issue = "35121")] - impl PartialOrd for ! { - fn partial_cmp(&self, _: &!) -> Option { - *self - } - } - - #[unstable(feature = "never_type", issue = "35121")] - impl Ord for ! { - fn cmp(&self, _: &!) -> Ordering { - *self - } - } + #[unstable(feature = "never_type", issue = "35121")] + impl PartialEq for ! { + fn eq(&self, _: &!) -> bool { + *self } } - #[cfg(not(stage0))] - not_stage0!(); + #[unstable(feature = "never_type", issue = "35121")] + impl Eq for ! {} + + #[unstable(feature = "never_type", issue = "35121")] + impl PartialOrd for ! { + fn partial_cmp(&self, _: &!) -> Option { + *self + } + } + + #[unstable(feature = "never_type", issue = "35121")] + impl Ord for ! { + fn cmp(&self, _: &!) -> Ordering { + *self + } + } // & pointers diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index dbd715c722e..7688da971eb 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -1363,28 +1363,19 @@ macro_rules! fmt_refs { fmt_refs! { Debug, Display, Octal, Binary, LowerHex, UpperHex, LowerExp, UpperExp } -// Note: This macro is a temporary hack that can be remove once we are building with a compiler -// that supports `!` -macro_rules! not_stage0 { - () => { - #[unstable(feature = "never_type", issue = "35121")] - impl Debug for ! { - fn fmt(&self, _: &mut Formatter) -> Result { - *self - } - } - - #[unstable(feature = "never_type", issue = "35121")] - impl Display for ! { - fn fmt(&self, _: &mut Formatter) -> Result { - *self - } - } +#[unstable(feature = "never_type", issue = "35121")] +impl Debug for ! { + fn fmt(&self, _: &mut Formatter) -> Result { + *self } } -#[cfg(not(stage0))] -not_stage0!(); +#[unstable(feature = "never_type", issue = "35121")] +impl Display for ! { + fn fmt(&self, _: &mut Formatter) -> Result { + *self + } +} #[stable(feature = "rust1", since = "1.0.0")] impl Debug for bool { diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 2a9678203e1..fbeddf26b93 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -67,8 +67,6 @@ #![deny(missing_debug_implementations)] #![cfg_attr(not(stage0), deny(warnings))] -#![cfg_attr(stage0, allow(unused_attributes))] - #![feature(allow_internal_unstable)] #![feature(asm)] #![feature(associated_type_defaults)] @@ -92,9 +90,7 @@ #![feature(staged_api)] #![feature(unboxed_closures)] #![feature(question_mark)] - -// NOTE: remove the cfg_attr next snapshot -#![cfg_attr(not(stage0), feature(never_type))] +#![feature(never_type)] #[macro_use] mod macros; diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs index fdae8f69a9c..bd0c2f5126d 100644 --- a/src/libpanic_unwind/gcc.rs +++ b/src/libpanic_unwind/gcc.rs @@ -264,30 +264,6 @@ unsafe fn find_eh_action(context: *mut uw::_Unwind_Context) -> EHAction { eh::find_eh_action(lsda, &eh_context) } -// *** Delete after a new snapshot *** -#[cfg(all(stage0, any(target_os = "ios", not(target_arch = "arm"))))] -#[lang = "eh_personality_catch"] -#[no_mangle] -pub unsafe extern "C" fn rust_eh_personality_catch(version: c_int, - actions: uw::_Unwind_Action, - exception_class: uw::_Unwind_Exception_Class, - ue_header: *mut uw::_Unwind_Exception, - context: *mut uw::_Unwind_Context) - -> uw::_Unwind_Reason_Code { - rust_eh_personality(version, actions, exception_class, ue_header, context) -} - -// *** Delete after a new snapshot *** -#[cfg(all(stage0, target_arch = "arm", not(target_os = "ios")))] -#[lang = "eh_personality_catch"] -#[no_mangle] -pub unsafe extern "C" fn rust_eh_personality_catch(state: uw::_Unwind_State, - ue_header: *mut uw::_Unwind_Exception, - context: *mut uw::_Unwind_Context) - -> uw::_Unwind_Reason_Code { - rust_eh_personality(state, ue_header, context) -} - // See docs in the `unwind` module. #[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))] #[lang = "eh_unwind_resume"] diff --git a/src/libpanic_unwind/seh64_gnu.rs b/src/libpanic_unwind/seh64_gnu.rs index 3642e248895..e6d3920b29c 100644 --- a/src/libpanic_unwind/seh64_gnu.rs +++ b/src/libpanic_unwind/seh64_gnu.rs @@ -81,21 +81,6 @@ pub unsafe fn cleanup(ptr: *mut u8) -> Box { // This is considered acceptable, because the behavior of throwing exceptions // through a C ABI boundary is undefined. -// *** Delete after a new snapshot *** -#[cfg(stage0)] -#[lang = "eh_personality_catch"] -#[cfg(not(test))] -unsafe extern "C" fn rust_eh_personality_catch(exceptionRecord: *mut c::EXCEPTION_RECORD, - establisherFrame: c::LPVOID, - contextRecord: *mut c::CONTEXT, - dispatcherContext: *mut c::DISPATCHER_CONTEXT) - -> c::EXCEPTION_DISPOSITION { - rust_eh_personality(exceptionRecord, - establisherFrame, - contextRecord, - dispatcherContext) -} - #[lang = "eh_personality"] #[cfg(not(test))] unsafe extern "C" fn rust_eh_personality(exceptionRecord: *mut c::EXCEPTION_RECORD,