Warn on all erroneous constants
This commit is contained in:
parent
52ed3d8761
commit
cd6c186e4e
18 changed files with 233 additions and 75 deletions
|
@ -14,6 +14,7 @@ const X: u32 = 5;
|
|||
const Y: u32 = 6;
|
||||
const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
||||
//~^ WARN attempt to subtract with overflow
|
||||
//~| WARN this constant cannot be used
|
||||
|
||||
fn main() {
|
||||
println!("{}", FOO);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue