add #![feature(never_type)] to tests as needed

This commit is contained in:
Niko Matsakis 2019-12-11 11:46:56 -05:00
parent dc49b2cdfd
commit 405eefe467
9 changed files with 16 additions and 11 deletions

View File

@ -5,6 +5,7 @@
// compile-flags: --emit mir,link // compile-flags: --emit mir,link
#![feature(const_panic)] #![feature(const_panic)]
#![feature(never_type)]
struct PrintName<T>(T); struct PrintName<T>(T);

View File

@ -1,5 +1,6 @@
// Regression test for #66975 // Regression test for #66975
#![warn(const_err)] #![warn(const_err)]
#![feature(never_type)]
struct PrintName<T>(T); struct PrintName<T>(T);

View File

@ -1,5 +1,5 @@
warning: any use of this value will cause an error 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] }; LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
| --------------------------------------------------------^^^^^--- | --------------------------------------------------------^^^^^---
@ -13,7 +13,7 @@ LL | #![warn(const_err)]
| ^^^^^^^^^ | ^^^^^^^^^
error: erroneous constant encountered 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; LL | let _ = PrintName::<T>::VOID;
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^

View File

@ -1,6 +1,7 @@
// Regression test for #66975 // Regression test for #66975
#![warn(const_err)] #![warn(const_err)]
#![feature(const_panic)] #![feature(const_panic)]
#![feature(never_type)]
struct PrintName; struct PrintName;

View File

@ -1,10 +1,10 @@
warning: any use of this value will cause an error 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!(); 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 note: lint level defined here
--> $DIR/panic-assoc-never-type.rs:2:9 --> $DIR/panic-assoc-never-type.rs:2:9
@ -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) = 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 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; LL | let _ = PrintName::VOID;
| ^^^^^^^^^^^^^^^ referenced constant has errors | ^^^^^^^^^^^^^^^ referenced constant has errors

View File

@ -1,6 +1,7 @@
// Regression test for #66975 // Regression test for #66975
#![warn(const_err)] #![warn(const_err)]
#![feature(const_panic)] #![feature(const_panic)]
#![feature(never_type)]
const VOID: ! = panic!(); const VOID: ! = panic!();
//~^ WARN any use of this value will cause an error //~^ WARN any use of this value will cause an error

View File

@ -1,10 +1,10 @@
warning: any use of this value will cause an error 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!(); 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 note: lint level defined here
--> $DIR/panic-never-type.rs:2:9 --> $DIR/panic-never-type.rs:2:9
@ -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) = 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 error[E0080]: erroneous constant used
--> $DIR/panic-never-type.rs:9:13 --> $DIR/panic-never-type.rs:10:13
| |
LL | let _ = VOID; LL | let _ = VOID;
| ^^^^ referenced constant has errors | ^^^^ referenced constant has errors

View File

@ -29,7 +29,7 @@ LL | break;
| ^^^^^ | ^^^^^
error[E0571]: `break` with value from a `while` loop 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 () { LL | if break () {
| ^^^^^^^^ can only break with a value inside `loop` or breakable block | ^^^^^^^^ can only break with a value inside `loop` or breakable block
@ -40,7 +40,7 @@ LL | if break {
| ^^^^^ | ^^^^^
error[E0571]: `break` with value from a `while` loop 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; LL | break None;
| ^^^^^^^^^^ can only break with a value inside `loop` or breakable block | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
@ -51,7 +51,7 @@ LL | break;
| ^^^^^ | ^^^^^
error[E0571]: `break` with value from a `while` loop 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"; LL | break 'while_let_loop "nope";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block

View File

@ -1,6 +1,7 @@
// check-pass // check-pass
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
#![feature(never_type)]
fn main() { fn main() {
enum Void {} enum Void {}