Skip to content

Commit

Permalink
Remove #![feature(never_type)] from tests.
Browse files Browse the repository at this point in the history
Also remove `never_type` the feature-gate test.
  • Loading branch information
Centril committed Nov 21, 2019
1 parent 15c30dd commit 8f6197f
Show file tree
Hide file tree
Showing 101 changed files with 130 additions and 277 deletions.
2 changes: 0 additions & 2 deletions src/test/codegen/enum-debug-niche-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i64 4294967295{{[,)].*}}
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}

#![feature(never_type)]

#[derive(Copy, Clone)]
pub struct Entity {
private: std::num::NonZeroU32,
Expand Down
2 changes: 0 additions & 2 deletions src/test/mir-opt/uninhabited-enum.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(never_type)]

pub enum Void {}

#[no_mangle]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ trait Add<RHS=Self> {
fn ice<A>(a: A) {
let r = loop {};
r = r + a;
//~^ ERROR the trait bound `(): Add<A>` is not satisfied
//~^ ERROR the trait bound `!: Add<A>` is not satisfied
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `(): Add<A>` is not satisfied
error[E0277]: the trait bound `!: Add<A>` is not satisfied
--> $DIR/associated-types-ICE-when-projecting-out-of-err.rs:23:11
|
LL | r = r + a;
| ^ the trait `Add<A>` is not implemented for `()`
| ^ the trait `Add<A>` is not implemented for `!`

error: aborting due to previous error

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/binding/empty-types-in-patterns.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
#![feature(never_type)]
#![feature(exhaustive_patterns)]
#![feature(slice_patterns)]
#![allow(unreachable_patterns)]
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/borrowck/assign-never-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

// check-pass

#![feature(never_type)]

pub fn main() {
loop {
match None {
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/break-while-condition.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(never_type)]

fn main() {
// The `if false` expressions are simply to
// make sure we don't avoid checking everything
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/break-while-condition.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/break-while-condition.rs:9:20
--> $DIR/break-while-condition.rs:7:20
|
LL | let _: ! = {
| ____________________^
Expand All @@ -11,7 +11,7 @@ LL | | };
found type `()`

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

error[E0308]: mismatched types
--> $DIR/break-while-condition.rs:24:13
--> $DIR/break-while-condition.rs:22:13
|
LL | / while false {
LL | | return
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/coercion/coerce-issue-49593-box-never.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// check-pass

#![feature(never_type)]
#![allow(unreachable_code)]

use std::error::Error;
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/coercion/coerce-to-bang-cast.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(never_type)]

fn foo(x: usize, y: !, z: usize) { }

fn cast_a() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/coercion/coerce-to-bang-cast.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0605]: non-primitive cast: `i32` as `!`
--> $DIR/coerce-to-bang-cast.rs:6:13
--> $DIR/coerce-to-bang-cast.rs:4:13
|
LL | let y = {return; 22} as !;
| ^^^^^^^^^^^^^^^^^
|
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait

error[E0605]: non-primitive cast: `i32` as `!`
--> $DIR/coerce-to-bang-cast.rs:11:13
--> $DIR/coerce-to-bang-cast.rs:9:13
|
LL | let y = 22 as !;
| ^^^^^^^
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/coercion/coerce-to-bang.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(never_type)]

fn foo(x: usize, y: !, z: usize) { }

fn call_foo_a() {
Expand Down
20 changes: 10 additions & 10 deletions src/test/ui/coercion/coerce-to-bang.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:6:17
--> $DIR/coerce-to-bang.rs:4:17
|
LL | foo(return, 22, 44);
| ^^ expected !, found integer
Expand All @@ -8,7 +8,7 @@ LL | foo(return, 22, 44);
found type `{integer}`

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

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

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

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

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

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

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

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

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:76:37
--> $DIR/coerce-to-bang.rs:74:37
|
LL | let x: (usize, !, usize) = (22, 44, return);
| ^^ expected !, found integer
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/validate_never_arrays.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(const_raw_ptr_deref, never_type)]
#![feature(const_raw_ptr_deref)]

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

Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/empty/empty-never-array.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(never_type)]

enum Helper<T, U> {
T(T, [!; 0]),
#[allow(dead_code)]
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/empty/empty-never-array.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0005]: refutable pattern in local binding: `T(_, _)` not covered
--> $DIR/empty-never-array.rs:10:9
--> $DIR/empty-never-array.rs:8:9
|
LL | / enum Helper<T, U> {
LL | | T(T, [!; 0]),
Expand All @@ -20,7 +20,7 @@ LL | if let Helper::U(u) = Helper::T(t, []) { /* */ }
|

error[E0381]: use of possibly-uninitialized variable: `u`
--> $DIR/empty-never-array.rs:12:5
--> $DIR/empty-never-array.rs:10:5
|
LL | u
| ^ use of possibly-uninitialized `u`
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(never_type)]

fn foo() -> Result<u32, !> {
Ok(123)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0005]: refutable pattern in local binding: `Err(_)` not covered
--> $DIR/feature-gate-exhaustive-patterns.rs:8:9
--> $DIR/feature-gate-exhaustive-patterns.rs:6:9
|
LL | let Ok(_x) = foo();
| ^^^^^^ pattern `Err(_)` not covered
Expand Down
17 changes: 0 additions & 17 deletions src/test/ui/feature-gates/feature-gate-never_type.rs

This file was deleted.

48 changes: 0 additions & 48 deletions src/test/ui/feature-gates/feature-gate-never_type.stderr

This file was deleted.

1 change: 0 additions & 1 deletion src/test/ui/for-loop-while/loop-break-value.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// run-pass

#![allow(unreachable_code)]
#![feature(never_type)]

#[allow(unused)]
fn never_returns() {
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/lint/must_use-unit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(never_type)]
#![deny(unused_must_use)]

#[must_use]
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/lint/must_use-unit.stderr
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
error: unused return value of `foo` that must be used
--> $DIR/must_use-unit.rs:13:5
--> $DIR/must_use-unit.rs:12:5
|
LL | foo();
| ^^^^^^
|
note: lint level defined here
--> $DIR/must_use-unit.rs:2:9
--> $DIR/must_use-unit.rs:1:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^

error: unused return value of `bar` that must be used
--> $DIR/must_use-unit.rs:15:5
--> $DIR/must_use-unit.rs:14:5
|
LL | bar();
| ^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lint/uninitialized-zeroed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This test checks that calling `mem::{uninitialized,zeroed}` with certain types results
// in a lint.

#![feature(never_type, rustc_attrs)]
#![feature(rustc_attrs)]
#![allow(deprecated)]
#![deny(invalid_value)]

Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/loops/loop-break-value.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(never_type)]

fn main() {
let val: ! = loop { break break; };
//~^ ERROR mismatched types
Expand Down
Loading

0 comments on commit 8f6197f

Please sign in to comment.