make const_err a hard error
This commit is contained in:
parent
5854680388
commit
fd59d44f58
254 changed files with 1460 additions and 5402 deletions
|
@ -1,16 +1,8 @@
|
|||
// build-fail
|
||||
|
||||
#![warn(const_err)]
|
||||
|
||||
const X: u32 = 5;
|
||||
const Y: u32 = 6;
|
||||
const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
||||
//~^ WARN any use of this value will cause an error
|
||||
//~| WARN this was previously accepted by the compiler but is being phased out
|
||||
//~^ ERROR constant
|
||||
|
||||
fn main() {
|
||||
println!("{}", FOO);
|
||||
//~^ ERROR evaluation of constant value failed
|
||||
//~| WARN erroneous constant used [const_err]
|
||||
//~| WARN this was previously accepted by the compiler but is being phased out
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue