Skip to content

Commit

Permalink
add #![feature(never_type)] to tests as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Matsakis committed Dec 11, 2019
1 parent 951a38c commit 6613e33
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/test/mir-opt/retain-never-const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// compile-flags: --emit mir,link

#![feature(const_panic)]
#![feature(never_type)]

struct PrintName<T>(T);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Regression test for #66975
#![warn(const_err)]
#![feature(never_type)]

struct PrintName<T>(T);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: any use of this value will cause an error
--> $DIR/index-out-of-bounds-never-type.rs:7:61
--> $DIR/index-out-of-bounds-never-type.rs:8:61
|
LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
| --------------------------------------------------------^^^^^---
Expand All @@ -13,7 +13,7 @@ LL | #![warn(const_err)]
| ^^^^^^^^^

error: erroneous constant encountered
--> $DIR/index-out-of-bounds-never-type.rs:12:13
--> $DIR/index-out-of-bounds-never-type.rs:13:13
|
LL | let _ = PrintName::<T>::VOID;
| ^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/consts/const-eval/panic-assoc-never-type.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Regression test for #66975
#![warn(const_err)]
#![feature(const_panic)]
#![feature(never_type)]

struct PrintName;

Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/consts/const-eval/panic-assoc-never-type.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
warning: any use of this value will cause an error
--> $DIR/panic-assoc-never-type.rs:8:21
--> $DIR/panic-assoc-never-type.rs:9:21
|
LL | const VOID: ! = panic!();
| ----------------^^^^^^^^-
| |
| the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:8:21
| the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:9:21
|
note: lint level defined here
--> $DIR/panic-assoc-never-type.rs:2:9
Expand All @@ -14,7 +14,7 @@ LL | #![warn(const_err)]
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0080]: erroneous constant used
--> $DIR/panic-assoc-never-type.rs:13:13
--> $DIR/panic-assoc-never-type.rs:14:13
|
LL | let _ = PrintName::VOID;
| ^^^^^^^^^^^^^^^ referenced constant has errors
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/consts/const-eval/panic-never-type.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Regression test for #66975
#![warn(const_err)]
#![feature(const_panic)]
#![feature(never_type)]

const VOID: ! = panic!();
//~^ WARN any use of this value will cause an error
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/consts/const-eval/panic-never-type.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
warning: any use of this value will cause an error
--> $DIR/panic-never-type.rs:5:17
--> $DIR/panic-never-type.rs:6:17
|
LL | const VOID: ! = panic!();
| ----------------^^^^^^^^-
| |
| the evaluated program panicked at 'explicit panic', $DIR/panic-never-type.rs:5:17
| the evaluated program panicked at 'explicit panic', $DIR/panic-never-type.rs:6:17
|
note: lint level defined here
--> $DIR/panic-never-type.rs:2:9
Expand All @@ -14,7 +14,7 @@ LL | #![warn(const_err)]
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error[E0080]: erroneous constant used
--> $DIR/panic-never-type.rs:9:13
--> $DIR/panic-never-type.rs:10:13
|
LL | let _ = VOID;
| ^^^^ referenced constant has errors
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/loops/loop-break-value.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LL | break;
| ^^^^^

error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:36:12
--> $DIR/loop-break-value.rs:38:12
|
LL | if break () {
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
Expand All @@ -40,7 +40,7 @@ LL | if break {
| ^^^^^

error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:41:9
--> $DIR/loop-break-value.rs:43:9
|
LL | break None;
| ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
Expand All @@ -51,7 +51,7 @@ LL | break;
| ^^^^^

error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:47:13
--> $DIR/loop-break-value.rs:49:13
|
LL | break 'while_let_loop "nope";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/never_type/auto-traits.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// check-pass

#![feature(optin_builtin_traits)]
#![feature(never_type)]

fn main() {
enum Void {}
Expand Down

0 comments on commit 6613e33

Please sign in to comment.