1
Fork 0

lowering casts in constants now creates multiple uses

This can trigger more errors than before. Not sure what is the best
fix here.
This commit is contained in:
Niko Matsakis 2018-10-18 05:58:20 -04:00
parent 26fdac6224
commit d5d5e8c5f5
3 changed files with 21 additions and 6 deletions

View file

@ -14,9 +14,10 @@ const X: u32 = 5;
const Y: u32 = 6;
const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
//~^ WARN this constant cannot be used
//~| ERROR
fn main() {
println!("{}", FOO);
//~^ ERROR erroneous constant used
//~| E0080
//~^ ERROR
//~| ERROR
}