Skip to content

Commit 15c30dd

Browse files
committed
Stabilize the never_type, written !.
1 parent f1b882b commit 15c30dd

File tree

21 files changed

+26
-52
lines changed

21 files changed

+26
-52
lines changed

src/libcore/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ mod impls {
185185
bool char
186186
}
187187

188-
#[unstable(feature = "never_type", issue = "35121")]
188+
#[stable(feature = "never_type", since = "1.41.0")]
189189
impl Clone for ! {
190190
#[inline]
191191
fn clone(&self) -> Self {

src/libcore/cmp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,24 +1128,24 @@ mod impls {
11281128

11291129
ord_impl! { char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 }
11301130

1131-
#[unstable(feature = "never_type", issue = "35121")]
1131+
#[stable(feature = "never_type", since = "1.41.0")]
11321132
impl PartialEq for ! {
11331133
fn eq(&self, _: &!) -> bool {
11341134
*self
11351135
}
11361136
}
11371137

1138-
#[unstable(feature = "never_type", issue = "35121")]
1138+
#[stable(feature = "never_type", since = "1.41.0")]
11391139
impl Eq for ! {}
11401140

1141-
#[unstable(feature = "never_type", issue = "35121")]
1141+
#[stable(feature = "never_type", since = "1.41.0")]
11421142
impl PartialOrd for ! {
11431143
fn partial_cmp(&self, _: &!) -> Option<Ordering> {
11441144
*self
11451145
}
11461146
}
11471147

1148-
#[unstable(feature = "never_type", issue = "35121")]
1148+
#[stable(feature = "never_type", since = "1.41.0")]
11491149
impl Ord for ! {
11501150
fn cmp(&self, _: &!) -> Ordering {
11511151
*self

src/libcore/fmt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,14 +1935,14 @@ macro_rules! fmt_refs {
19351935

19361936
fmt_refs! { Debug, Display, Octal, Binary, LowerHex, UpperHex, LowerExp, UpperExp }
19371937

1938-
#[unstable(feature = "never_type", issue = "35121")]
1938+
#[stable(feature = "never_type", since = "1.41.0")]
19391939
impl Debug for ! {
19401940
fn fmt(&self, _: &mut Formatter<'_>) -> Result {
19411941
*self
19421942
}
19431943
}
19441944

1945-
#[unstable(feature = "never_type", issue = "35121")]
1945+
#[stable(feature = "never_type", since = "1.41.0")]
19461946
impl Display for ! {
19471947
fn fmt(&self, _: &mut Formatter<'_>) -> Result {
19481948
*self

src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
#![feature(iter_once_with)]
8686
#![feature(lang_items)]
8787
#![feature(link_llvm_intrinsics)]
88-
#![feature(never_type)]
88+
#![cfg_attr(bootstrap, feature(never_type))]
8989
#![feature(nll)]
9090
#![feature(exhaustive_patterns)]
9191
#![feature(no_core)]

src/libcore/marker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ mod copy_impls {
774774
bool char
775775
}
776776

777-
#[unstable(feature = "never_type", issue = "35121")]
777+
#[stable(feature = "never_type", since = "1.41.0")]
778778
impl Copy for ! {}
779779

780780
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4728,7 +4728,7 @@ impl From<Infallible> for TryFromIntError {
47284728
}
47294729
}
47304730

4731-
#[unstable(feature = "never_type", issue = "35121")]
4731+
#[stable(feature = "never_type", since = "1.41.0")]
47324732
impl From<!> for TryFromIntError {
47334733
fn from(never: !) -> TryFromIntError {
47344734
// Match rather than coerce to make sure that code like

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#![feature(core_intrinsics)]
3737
#![feature(drain_filter)]
3838
#![cfg_attr(windows, feature(libc))]
39-
#![feature(never_type)]
39+
#![cfg_attr(bootstrap, feature(never_type))]
4040
#![feature(exhaustive_patterns)]
4141
#![feature(overlapping_marker_traits)]
4242
#![feature(extern_types)]

src/librustc/ty/context.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,11 +2440,7 @@ impl<'tcx> TyCtxt<'tcx> {
24402440

24412441
#[inline]
24422442
pub fn mk_diverging_default(self) -> Ty<'tcx> {
2443-
if self.features().never_type {
2444-
self.types.never
2445-
} else {
2446-
self.intern_tup(&[])
2447-
}
2443+
self.types.never
24482444
}
24492445

24502446
#[inline]

src/librustc_codegen_utils/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![feature(box_patterns)]
99
#![feature(box_syntax)]
1010
#![feature(core_intrinsics)]
11-
#![feature(never_type)]
11+
#![cfg_attr(bootstrap, feature(never_type))]
1212
#![feature(nll)]
1313
#![feature(in_band_lifetimes)]
1414

src/librustc_error_codes/error_codes/E0725.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ command line flags.
44
Erroneous code example:
55

66
```ignore (can't specify compiler flags from doctests)
7-
#![feature(never_type)] // error: the feature `never_type` is not in
8-
// the list of allowed features
7+
#![feature(specialization)] // error: the feature `specialization` is not in
8+
// the list of allowed features
99
```
1010

1111
Delete the offending feature attribute, or add it to the list of allowed

0 commit comments

Comments
 (0)