Skip to content
Permalink
Browse files

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

  • Loading branch information
nikomatsakis committed Dec 11, 2019
1 parent dc49b2c commit 405eefe467435559efe57b4e3fc7c00aa965938c
@@ -5,6 +5,7 @@
// compile-flags: --emit mir,link

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

struct PrintName<T>(T);

@@ -1,5 +1,6 @@
// Regression test for #66975
#![warn(const_err)]
#![feature(never_type)]

struct PrintName<T>(T);

@@ -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] };
| --------------------------------------------------------^^^^^---
@@ -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;
| ^^^^^^^^^^^^^^^^^^^^
@@ -1,6 +1,7 @@
// Regression test for #66975
#![warn(const_err)]
#![feature(const_panic)]
#![feature(never_type)]

struct PrintName;

@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,6 +1,7 @@
// check-pass

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

fn main() {
enum Void {}

0 comments on commit 405eefe

Please sign in to comment.
You can’t perform that action at this time.