Remove old stage0 compatibility

This commit is contained in:
Brian Anderson 2016-08-18 17:08:25 +00:00
parent ab6ca7e98f
commit fce605e1f2
5 changed files with 31 additions and 92 deletions

View File

@ -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<Ordering> {
*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<Ordering> {
*self
}
}
#[unstable(feature = "never_type", issue = "35121")]
impl Ord for ! {
fn cmp(&self, _: &!) -> Ordering {
*self
}
}
// & pointers

View File

@ -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 {

View File

@ -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;

View File

@ -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"]

View File

@ -81,21 +81,6 @@ pub unsafe fn cleanup(ptr: *mut u8) -> Box<Any + Send> {
// 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,