Skip to content

Commit 8f6197f

Browse files
committed
Remove #![feature(never_type)] from tests.
Also remove `never_type` the feature-gate test.
1 parent 15c30dd commit 8f6197f

File tree

101 files changed

+130
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+130
-277
lines changed

src/test/codegen/enum-debug-niche-2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i64 4294967295{{[,)].*}}
1313
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}
1414

15-
#![feature(never_type)]
16-
1715
#[derive(Copy, Clone)]
1816
pub struct Entity {
1917
private: std::num::NonZeroU32,

src/test/mir-opt/uninhabited-enum.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(never_type)]
2-
31
pub enum Void {}
42

53
#[no_mangle]

src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ trait Add<RHS=Self> {
2121
fn ice<A>(a: A) {
2222
let r = loop {};
2323
r = r + a;
24-
//~^ ERROR the trait bound `(): Add<A>` is not satisfied
24+
//~^ ERROR the trait bound `!: Add<A>` is not satisfied
2525
}

src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0277]: the trait bound `(): Add<A>` is not satisfied
1+
error[E0277]: the trait bound `!: Add<A>` is not satisfied
22
--> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:23:11
33
|
44
LL | r = r + a;
5-
| ^ the trait `Add<A>` is not implemented for `()`
5+
| ^ the trait `Add<A>` is not implemented for `!`
66

77
error: aborting due to previous error
88

src/test/ui/binding/empty-types-in-patterns.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
#![feature(never_type)]
32
#![feature(exhaustive_patterns)]
43
#![feature(slice_patterns)]
54
#![allow(unreachable_patterns)]

src/test/ui/borrowck/assign-never-type.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
// check-pass
44

5-
#![feature(never_type)]
6-
75
pub fn main() {
86
loop {
97
match None {

src/test/ui/break-while-condition.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(never_type)]
2-
31
fn main() {
42
// The `if false` expressions are simply to
53
// make sure we don't avoid checking everything

src/test/ui/break-while-condition.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/break-while-condition.rs:9:20
2+
--> $DIR/break-while-condition.rs:7:20
33
|
44
LL | let _: ! = {
55
| ____________________^
@@ -11,7 +11,7 @@ LL | | };
1111
found type `()`
1212

1313
error[E0308]: mismatched types
14-
--> $DIR/break-while-condition.rs:16:13
14+
--> $DIR/break-while-condition.rs:14:13
1515
|
1616
LL | / while false {
1717
LL | | break
@@ -22,7 +22,7 @@ LL | | }
2222
found type `()`
2323

2424
error[E0308]: mismatched types
25-
--> $DIR/break-while-condition.rs:24:13
25+
--> $DIR/break-while-condition.rs:22:13
2626
|
2727
LL | / while false {
2828
LL | | return

src/test/ui/coercion/coerce-issue-49593-box-never.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// check-pass
22

3-
#![feature(never_type)]
43
#![allow(unreachable_code)]
54

65
use std::error::Error;

src/test/ui/coercion/coerce-to-bang-cast.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(never_type)]
2-
31
fn foo(x: usize, y: !, z: usize) { }
42

53
fn cast_a() {

src/test/ui/coercion/coerce-to-bang-cast.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0605]: non-primitive cast: `i32` as `!`
2-
--> $DIR/coerce-to-bang-cast.rs:6:13
2+
--> $DIR/coerce-to-bang-cast.rs:4:13
33
|
44
LL | let y = {return; 22} as !;
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
88

99
error[E0605]: non-primitive cast: `i32` as `!`
10-
--> $DIR/coerce-to-bang-cast.rs:11:13
10+
--> $DIR/coerce-to-bang-cast.rs:9:13
1111
|
1212
LL | let y = 22 as !;
1313
| ^^^^^^^

src/test/ui/coercion/coerce-to-bang.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(never_type)]
2-
31
fn foo(x: usize, y: !, z: usize) { }
42

53
fn call_foo_a() {

src/test/ui/coercion/coerce-to-bang.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/coerce-to-bang.rs:6:17
2+
--> $DIR/coerce-to-bang.rs:4:17
33
|
44
LL | foo(return, 22, 44);
55
| ^^ expected !, found integer
@@ -8,7 +8,7 @@ LL | foo(return, 22, 44);
88
found type `{integer}`
99

1010
error[E0308]: mismatched types
11-
--> $DIR/coerce-to-bang.rs:18:13
11+
--> $DIR/coerce-to-bang.rs:16:13
1212
|
1313
LL | foo(22, 44, return);
1414
| ^^ expected !, found integer
@@ -17,7 +17,7 @@ LL | foo(22, 44, return);
1717
found type `{integer}`
1818

1919
error[E0308]: mismatched types
20-
--> $DIR/coerce-to-bang.rs:26:12
20+
--> $DIR/coerce-to-bang.rs:24:12
2121
|
2222
LL | foo(a, b, c); // ... and hence a reference to `a` is expected to diverge.
2323
| ^ expected !, found integer
@@ -26,7 +26,7 @@ LL | foo(a, b, c); // ... and hence a reference to `a` is expected to diverg
2626
found type `{integer}`
2727

2828
error[E0308]: mismatched types
29-
--> $DIR/coerce-to-bang.rs:36:12
29+
--> $DIR/coerce-to-bang.rs:34:12
3030
|
3131
LL | foo(a, b, c);
3232
| ^ expected !, found integer
@@ -35,7 +35,7 @@ LL | foo(a, b, c);
3535
found type `{integer}`
3636

3737
error[E0308]: mismatched types
38-
--> $DIR/coerce-to-bang.rs:45:12
38+
--> $DIR/coerce-to-bang.rs:43:12
3939
|
4040
LL | foo(a, b, c);
4141
| ^ expected !, found integer
@@ -44,7 +44,7 @@ LL | foo(a, b, c);
4444
found type `{integer}`
4545

4646
error[E0308]: mismatched types
47-
--> $DIR/coerce-to-bang.rs:50:21
47+
--> $DIR/coerce-to-bang.rs:48:21
4848
|
4949
LL | let x: [!; 2] = [return, 22];
5050
| ^^^^^^^^^^^^ expected !, found integer
@@ -53,7 +53,7 @@ LL | let x: [!; 2] = [return, 22];
5353
found type `[{integer}; 2]`
5454

5555
error[E0308]: mismatched types
56-
--> $DIR/coerce-to-bang.rs:55:22
56+
--> $DIR/coerce-to-bang.rs:53:22
5757
|
5858
LL | let x: [!; 2] = [22, return];
5959
| ^^ expected !, found integer
@@ -62,7 +62,7 @@ LL | let x: [!; 2] = [22, return];
6262
found type `{integer}`
6363

6464
error[E0308]: mismatched types
65-
--> $DIR/coerce-to-bang.rs:60:37
65+
--> $DIR/coerce-to-bang.rs:58:37
6666
|
6767
LL | let x: (usize, !, usize) = (22, 44, 66);
6868
| ^^ expected !, found integer
@@ -71,7 +71,7 @@ LL | let x: (usize, !, usize) = (22, 44, 66);
7171
found type `{integer}`
7272

7373
error[E0308]: mismatched types
74-
--> $DIR/coerce-to-bang.rs:65:41
74+
--> $DIR/coerce-to-bang.rs:63:41
7575
|
7676
LL | let x: (usize, !, usize) = (return, 44, 66);
7777
| ^^ expected !, found integer
@@ -80,7 +80,7 @@ LL | let x: (usize, !, usize) = (return, 44, 66);
8080
found type `{integer}`
8181

8282
error[E0308]: mismatched types
83-
--> $DIR/coerce-to-bang.rs:76:37
83+
--> $DIR/coerce-to-bang.rs:74:37
8484
|
8585
LL | let x: (usize, !, usize) = (22, 44, return);
8686
| ^^ expected !, found integer

src/test/ui/consts/validate_never_arrays.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_raw_ptr_deref, never_type)]
1+
#![feature(const_raw_ptr_deref)]
22

33
const FOO: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; //~ ERROR undefined behavior
44

src/test/ui/empty/empty-never-array.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(never_type)]
2-
31
enum Helper<T, U> {
42
T(T, [!; 0]),
53
#[allow(dead_code)]

src/test/ui/empty/empty-never-array.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0005]: refutable pattern in local binding: `T(_, _)` not covered
2-
--> $DIR/empty-never-array.rs:10:9
2+
--> $DIR/empty-never-array.rs:8:9
33
|
44
LL | / enum Helper<T, U> {
55
LL | | T(T, [!; 0]),
@@ -20,7 +20,7 @@ LL | if let Helper::U(u) = Helper::T(t, []) { /* */ }
2020
|
2121

2222
error[E0381]: use of possibly-uninitialized variable: `u`
23-
--> $DIR/empty-never-array.rs:12:5
23+
--> $DIR/empty-never-array.rs:10:5
2424
|
2525
LL | u
2626
| ^ use of possibly-uninitialized `u`

src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(never_type)]
2-
31
fn foo() -> Result<u32, !> {
42
Ok(123)
53
}

src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0005]: refutable pattern in local binding: `Err(_)` not covered
2-
--> $DIR/feature-gate-exhaustive-patterns.rs:8:9
2+
--> $DIR/feature-gate-exhaustive-patterns.rs:6:9
33
|
44
LL | let Ok(_x) = foo();
55
| ^^^^^^ pattern `Err(_)` not covered

src/test/ui/feature-gates/feature-gate-never_type.rs

-17
This file was deleted.

src/test/ui/feature-gates/feature-gate-never_type.stderr

-48
This file was deleted.

src/test/ui/for-loop-while/loop-break-value.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![allow(unreachable_code)]
4-
#![feature(never_type)]
54

65
#[allow(unused)]
76
fn never_returns() {

src/test/ui/lint/must_use-unit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(never_type)]
21
#![deny(unused_must_use)]
32

43
#[must_use]

src/test/ui/lint/must_use-unit.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: unused return value of `foo` that must be used
2-
--> $DIR/must_use-unit.rs:13:5
2+
--> $DIR/must_use-unit.rs:12:5
33
|
44
LL | foo();
55
| ^^^^^^
66
|
77
note: lint level defined here
8-
--> $DIR/must_use-unit.rs:2:9
8+
--> $DIR/must_use-unit.rs:1:9
99
|
1010
LL | #![deny(unused_must_use)]
1111
| ^^^^^^^^^^^^^^^
1212

1313
error: unused return value of `bar` that must be used
14-
--> $DIR/must_use-unit.rs:15:5
14+
--> $DIR/must_use-unit.rs:14:5
1515
|
1616
LL | bar();
1717
| ^^^^^^

src/test/ui/lint/uninitialized-zeroed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This test checks that calling `mem::{uninitialized,zeroed}` with certain types results
33
// in a lint.
44

5-
#![feature(never_type, rustc_attrs)]
5+
#![feature(rustc_attrs)]
66
#![allow(deprecated)]
77
#![deny(invalid_value)]
88

src/test/ui/loops/loop-break-value.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(never_type)]
2-
31
fn main() {
42
let val: ! = loop { break break; };
53
//~^ ERROR mismatched types

0 commit comments

Comments
 (0)