diff options
| author | bors <bors@rust-lang.org> | 2019-12-14 22:02:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-12-14 22:02:59 +0000 |
| commit | 6f829840f7e5897745bc7b5ff951b006a2c4e0e3 (patch) | |
| tree | 0c73bcad1ba6245af90566e58a69def359b598cd /src/libstd | |
| parent | c8ea4ace9213ae045123fdfeb59d1ac887656d31 (diff) | |
| parent | 775076ff4dc9ce4986a1286669cfa268b01ac592 (diff) | |
| download | rust-6f829840f7e5897745bc7b5ff951b006a2c4e0e3.tar.gz rust-6f829840f7e5897745bc7b5ff951b006a2c4e0e3.zip | |
Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, r=centril
Revert stabilization of never type Fixes https://github.com/rust-lang/rust/issues/66757 I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean. ( cc @Centril, author of #65355, you may want to check this over briefly )
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/error.rs | 9 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/primitive_docs.rs | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/libstd/error.rs b/src/libstd/error.rs index ec1c444bcf8..d4c4cb9c3b9 100644 --- a/src/libstd/error.rs +++ b/src/libstd/error.rs @@ -465,7 +465,7 @@ impl<'a> From<Cow<'a, str>> for Box<dyn Error> { } } -#[stable(feature = "never_type", since = "1.41.0")] +#[unstable(feature = "never_type", issue = "35121")] impl Error for ! { fn description(&self) -> &str { *self } } @@ -551,6 +551,13 @@ impl Error for string::FromUtf16Error { } } +#[stable(feature = "str_parse_error2", since = "1.8.0")] +impl Error for string::ParseError { + fn description(&self) -> &str { + match *self {} + } +} + #[stable(feature = "decode_utf16", since = "1.9.0")] impl Error for char::DecodeUtf16Error { fn description(&self) -> &str { diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 8198ae73a31..de33a2cb214 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -281,7 +281,7 @@ #![feature(maybe_uninit_ref)] #![feature(maybe_uninit_slice)] #![feature(needs_panic_runtime)] -#![cfg_attr(bootstrap, feature(never_type))] +#![feature(never_type)] #![feature(nll)] #![cfg_attr(bootstrap, feature(on_unimplemented))] #![feature(optin_builtin_traits)] diff --git a/src/libstd/primitive_docs.rs b/src/libstd/primitive_docs.rs index b4495588c99..a72951c0346 100644 --- a/src/libstd/primitive_docs.rs +++ b/src/libstd/primitive_docs.rs @@ -71,6 +71,7 @@ mod prim_bool { } /// write: /// /// ``` +/// #![feature(never_type)] /// # fn foo() -> u32 { /// let x: ! = { /// return 123 @@ -200,6 +201,7 @@ mod prim_bool { } /// for example: /// /// ``` +/// #![feature(never_type)] /// # use std::fmt; /// # trait Debug { /// # fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result; @@ -237,7 +239,7 @@ mod prim_bool { } /// [`Default`]: default/trait.Default.html /// [`default()`]: default/trait.Default.html#tymethod.default /// -#[stable(feature = "never_type", since = "1.41.0")] +#[unstable(feature = "never_type", issue = "35121")] mod prim_never { } #[doc(primitive = "char")] |
