Turn the use of erroneous constants into errors again

This commit is contained in:
Oliver Schneider 2018-06-27 14:55:06 +02:00
parent 4eea1a4e5e
commit 4d473300a2
13 changed files with 45 additions and 42 deletions

View file

@ -12,7 +12,7 @@ note: lint level defined here
LL | #![warn(const_err)]
| ^^^^^^^^^
warning: referenced constant
warning: referenced constant has errors
--> $DIR/conditional_array_execution.rs:19:20
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
@ -27,7 +27,7 @@ warning: this expression will panic at runtime
LL | println!("{}", FOO);
| ^^^ referenced constant has errors
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/conditional_array_execution.rs:19:5
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
@ -48,7 +48,7 @@ LL | println!("{}", FOO);
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/conditional_array_execution.rs:19:20
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];

View file

@ -12,7 +12,7 @@ note: lint level defined here
LL | #![warn(const_err)]
| ^^^^^^^^^
warning: referenced constant
warning: referenced constant has errors
--> $DIR/conditional_array_execution.rs:19:20
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
@ -27,7 +27,7 @@ warning: this expression will panic at runtime
LL | println!("{}", FOO);
| ^^^ referenced constant has errors
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/conditional_array_execution.rs:19:20
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];

View file

@ -20,7 +20,7 @@ LL | const Y: u32 = foo(0-1);
| |
| attempt to subtract with overflow
warning: referenced constant
warning: referenced constant has errors
--> $DIR/issue-43197.rs:24:23
|
LL | const X: u32 = 0-1;
@ -35,7 +35,7 @@ warning: this expression will panic at runtime
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
warning: referenced constant
warning: referenced constant has errors
--> $DIR/issue-43197.rs:24:26
|
LL | const Y: u32 = foo(0-1);
@ -50,7 +50,7 @@ warning: this expression will panic at runtime
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-43197.rs:24:5
|
LL | const X: u32 = 0-1;
@ -71,7 +71,7 @@ LL | println!("{} {}", X, Y);
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-43197.rs:24:26
|
LL | const Y: u32 = foo(0-1);
@ -86,7 +86,7 @@ error[E0080]: erroneous constant used
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-43197.rs:24:23
|
LL | const X: u32 = 0-1;

View file

@ -20,7 +20,7 @@ LL | const Y: u32 = foo(0-1);
| |
| attempt to subtract with overflow
warning: referenced constant
warning: referenced constant has errors
--> $DIR/issue-43197.rs:24:23
|
LL | const X: u32 = 0-1;
@ -35,7 +35,7 @@ warning: this expression will panic at runtime
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
warning: referenced constant
warning: referenced constant has errors
--> $DIR/issue-43197.rs:24:26
|
LL | const Y: u32 = foo(0-1);
@ -50,7 +50,7 @@ warning: this expression will panic at runtime
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-43197.rs:24:26
|
LL | const Y: u32 = foo(0-1);
@ -65,7 +65,7 @@ error[E0080]: erroneous constant used
LL | println!("{} {}", X, Y);
| ^ referenced constant has errors
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-43197.rs:24:23
|
LL | const X: u32 = 0-1;

View file

@ -1,4 +1,4 @@
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-44578.rs:35:5
|
LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
@ -19,7 +19,7 @@ LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-44578.rs:35:20
|
LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];

View file

@ -1,4 +1,4 @@
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-44578.rs:35:20
|
LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];

View file

@ -1,4 +1,4 @@
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-50814-2.rs:26:5
|
LL | const BAR: usize = [5, 6, 7][T::BOO];

View file

@ -1,4 +1,4 @@
error[E0080]: referenced constant
error[E0080]: referenced constant has errors
--> $DIR/issue-50814.rs:27:5
|
LL | const MAX: u8 = A::MAX + B::MAX;