From 6613e3302a84e98f980b1d76f3d67478bfe0687a Mon Sep 17 00:00:00 2001 From: Nicholas Matsakis Date: Wed, 11 Dec 2019 11:46:56 -0500 Subject: [PATCH] add `#![feature(never_type)]` to tests as needed --- src/test/mir-opt/retain-never-const.rs | 1 + .../ui/consts/const-eval/index-out-of-bounds-never-type.rs | 1 + .../consts/const-eval/index-out-of-bounds-never-type.stderr | 4 ++-- src/test/ui/consts/const-eval/panic-assoc-never-type.rs | 1 + src/test/ui/consts/const-eval/panic-assoc-never-type.stderr | 6 +++--- src/test/ui/consts/const-eval/panic-never-type.rs | 1 + src/test/ui/consts/const-eval/panic-never-type.stderr | 6 +++--- src/test/ui/loops/loop-break-value.stderr | 6 +++--- src/test/ui/never_type/auto-traits.rs | 1 + 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/test/mir-opt/retain-never-const.rs b/src/test/mir-opt/retain-never-const.rs index 5d59b2f48429d..04394dcdf1334 100644 --- a/src/test/mir-opt/retain-never-const.rs +++ b/src/test/mir-opt/retain-never-const.rs @@ -5,6 +5,7 @@ // compile-flags: --emit mir,link #![feature(const_panic)] +#![feature(never_type)] struct PrintName(T); diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs index 516ca4f3f77e0..f6ab0bd7dbed6 100644 --- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs +++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs @@ -1,5 +1,6 @@ // Regression test for #66975 #![warn(const_err)] +#![feature(never_type)] struct PrintName(T); diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr index e2bd8d0cc85ea..24830f7344c3b 100644 --- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr +++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr @@ -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::(); [][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::::VOID; | ^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs index b39d9af5546f8..a7cbdb40ef108 100644 --- a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs +++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs @@ -1,6 +1,7 @@ // Regression test for #66975 #![warn(const_err)] #![feature(const_panic)] +#![feature(never_type)] struct PrintName; diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr index c07c8c65a2f20..e15952c20e493 100644 --- a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr +++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr @@ -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 diff --git a/src/test/ui/consts/const-eval/panic-never-type.rs b/src/test/ui/consts/const-eval/panic-never-type.rs index 42eabbf58470f..b1a7d8ae676a8 100644 --- a/src/test/ui/consts/const-eval/panic-never-type.rs +++ b/src/test/ui/consts/const-eval/panic-never-type.rs @@ -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 diff --git a/src/test/ui/consts/const-eval/panic-never-type.stderr b/src/test/ui/consts/const-eval/panic-never-type.stderr index 4fb11a61525f4..9e91fdf451415 100644 --- a/src/test/ui/consts/const-eval/panic-never-type.stderr +++ b/src/test/ui/consts/const-eval/panic-never-type.stderr @@ -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 diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr index e1568754f97ba..3bb0cd50d63fb 100644 --- a/src/test/ui/loops/loop-break-value.stderr +++ b/src/test/ui/loops/loop-break-value.stderr @@ -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 diff --git a/src/test/ui/never_type/auto-traits.rs b/src/test/ui/never_type/auto-traits.rs index 8a02720ab27fd..2d9689888cb30 100644 --- a/src/test/ui/never_type/auto-traits.rs +++ b/src/test/ui/never_type/auto-traits.rs @@ -1,6 +1,7 @@ // check-pass #![feature(optin_builtin_traits)] +#![feature(never_type)] fn main() { enum Void {}