Referring to erroneous constants in promoteds must abort the build
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-pass
|
||||
#![warn(const_err)]
|
||||
|
||||
const X: u32 = 5;
|
||||
@@ -20,4 +19,5 @@ const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
||||
fn main() {
|
||||
println!("{}", FOO);
|
||||
//~^ WARN this expression will panic at runtime
|
||||
//~| ERROR erroneous constant used
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user