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:
parent
26fdac6224
commit
d5d5e8c5f5
3 changed files with 21 additions and 6 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue