Don't const propagate the body of constants

This commit is contained in:
Oliver Schneider
2018-06-27 13:36:30 +02:00
parent 4bb9648b27
commit 4eea1a4e5e
18 changed files with 98 additions and 183 deletions

View File

@@ -13,8 +13,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
//~^ WARN this constant cannot be used
fn main() {
println!("{}", FOO);