Don't const propagate the body of constants
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user