Auto merge of #50121 - pnkfelix:revert-stabilization-of-never-type-et-al, r=alexcrichton
Revert stabilization of never_type (!) et al Fix #49691 I *think* this correctly adopts @nikomatsakis 's desired fix of: * reverting stabilization of `!` and `TryFrom`, and * returning to the previous fallback semantics (i.e. it is once again dependent on whether the crate has opted into `#[feature(never_type)]`, * **without** attempting to put back in the previous future-proofing warnings regarding the change in fallback semantics. (I'll be away from computers for a week starting now, so any updates to this PR should be either pushed into it, or someone else should adopt the task of polishing this fix and put up their own PR.)
This commit is contained in:
@@ -233,7 +233,7 @@ impl<'a> From<Cow<'a, str>> for Box<Error> {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "never_type", since = "1.26.0")]
|
||||
#[unstable(feature = "never_type", issue = "35121")]
|
||||
impl Error for ! {
|
||||
fn description(&self) -> &str { *self }
|
||||
}
|
||||
@@ -284,14 +284,14 @@ impl Error for num::ParseIntError {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "try_from", since = "1.26.0")]
|
||||
#[unstable(feature = "try_from", issue = "33417")]
|
||||
impl Error for num::TryFromIntError {
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "try_from", since = "1.26.0")]
|
||||
#[unstable(feature = "try_from", issue = "33417")]
|
||||
impl Error for array::TryFromSliceError {
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
@@ -365,7 +365,7 @@ impl Error for cell::BorrowMutError {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "try_from", since = "1.26.0")]
|
||||
#[unstable(feature = "try_from", issue = "33417")]
|
||||
impl Error for char::CharTryFromError {
|
||||
fn description(&self) -> &str {
|
||||
"converted integer out of range for `char`"
|
||||
|
||||
@@ -275,6 +275,7 @@
|
||||
#![feature(macro_reexport)]
|
||||
#![feature(macro_vis_matcher)]
|
||||
#![feature(needs_panic_runtime)]
|
||||
#![feature(never_type)]
|
||||
#![feature(exhaustive_patterns)]
|
||||
#![feature(nonzero)]
|
||||
#![feature(num_bits_bytes)]
|
||||
@@ -306,6 +307,7 @@
|
||||
#![feature(test, rustc_private)]
|
||||
#![feature(thread_local)]
|
||||
#![feature(toowned_clone_into)]
|
||||
#![feature(try_from)]
|
||||
#![feature(try_reserve)]
|
||||
#![feature(unboxed_closures)]
|
||||
#![feature(untagged_unions)]
|
||||
|
||||
@@ -79,6 +79,7 @@ mod prim_bool { }
|
||||
/// write:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(never_type)]
|
||||
/// # fn foo() -> u32 {
|
||||
/// let x: ! = {
|
||||
/// return 123
|
||||
@@ -155,6 +156,7 @@ mod prim_bool { }
|
||||
/// for example:
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(never_type)]
|
||||
/// # use std::fmt;
|
||||
/// # trait Debug {
|
||||
/// # fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result;
|
||||
|
||||
Reference in New Issue
Block a user