Skip to content

Commit 6613e33

Browse files
author
Nicholas Matsakis
committed
add #![feature(never_type)] to tests as needed
1 parent 951a38c commit 6613e33

9 files changed

+16
-11
lines changed

src/test/mir-opt/retain-never-const.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// compile-flags: --emit mir,link
66

77
#![feature(const_panic)]
8+
#![feature(never_type)]
89

910
struct PrintName<T>(T);
1011

src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Regression test for #66975
22
#![warn(const_err)]
3+
#![feature(never_type)]
34

45
struct PrintName<T>(T);
56

src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr

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

1515
error: erroneous constant encountered
16-
--> $DIR/index-out-of-bounds-never-type.rs:12:13
16+
--> $DIR/index-out-of-bounds-never-type.rs:13:13
1717
|
1818
LL | let _ = PrintName::<T>::VOID;
1919
| ^^^^^^^^^^^^^^^^^^^^

src/test/ui/consts/const-eval/panic-assoc-never-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Regression test for #66975
22
#![warn(const_err)]
33
#![feature(const_panic)]
4+
#![feature(never_type)]
45

56
struct PrintName;
67

src/test/ui/consts/const-eval/panic-assoc-never-type.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
warning: any use of this value will cause an error
2-
--> $DIR/panic-assoc-never-type.rs:8:21
2+
--> $DIR/panic-assoc-never-type.rs:9:21
33
|
44
LL | const VOID: ! = panic!();
55
| ----------------^^^^^^^^-
66
| |
7-
| the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:8:21
7+
| the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:9:21
88
|
99
note: lint level defined here
1010
--> $DIR/panic-assoc-never-type.rs:2:9
@@ -14,7 +14,7 @@ LL | #![warn(const_err)]
1414
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
1515

1616
error[E0080]: erroneous constant used
17-
--> $DIR/panic-assoc-never-type.rs:13:13
17+
--> $DIR/panic-assoc-never-type.rs:14:13
1818
|
1919
LL | let _ = PrintName::VOID;
2020
| ^^^^^^^^^^^^^^^ referenced constant has errors

src/test/ui/consts/const-eval/panic-never-type.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Regression test for #66975
22
#![warn(const_err)]
33
#![feature(const_panic)]
4+
#![feature(never_type)]
45

56
const VOID: ! = panic!();
67
//~^ WARN any use of this value will cause an error

src/test/ui/consts/const-eval/panic-never-type.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
warning: any use of this value will cause an error
2-
--> $DIR/panic-never-type.rs:5:17
2+
--> $DIR/panic-never-type.rs:6:17
33
|
44
LL | const VOID: ! = panic!();
55
| ----------------^^^^^^^^-
66
| |
7-
| the evaluated program panicked at 'explicit panic', $DIR/panic-never-type.rs:5:17
7+
| the evaluated program panicked at 'explicit panic', $DIR/panic-never-type.rs:6:17
88
|
99
note: lint level defined here
1010
--> $DIR/panic-never-type.rs:2:9
@@ -14,7 +14,7 @@ LL | #![warn(const_err)]
1414
= note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
1515

1616
error[E0080]: erroneous constant used
17-
--> $DIR/panic-never-type.rs:9:13
17+
--> $DIR/panic-never-type.rs:10:13
1818
|
1919
LL | let _ = VOID;
2020
| ^^^^ referenced constant has errors

src/test/ui/loops/loop-break-value.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LL | break;
2929
| ^^^^^
3030

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

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

5353
error[E0571]: `break` with value from a `while` loop
54-
--> $DIR/loop-break-value.rs:47:13
54+
--> $DIR/loop-break-value.rs:49:13
5555
|
5656
LL | break 'while_let_loop "nope";
5757
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block

src/test/ui/never_type/auto-traits.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// check-pass
22

33
#![feature(optin_builtin_traits)]
4+
#![feature(never_type)]
45

56
fn main() {
67
enum Void {}

0 commit comments

Comments
 (0)