blob: 440862090bd314f662851f32bef9397829ffc83a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#![warn(const_err)]
const fn foo(x: u32) -> u32 {
x
}
fn main() {
const X: u32 = 0-1;
//~^ WARN any use of this value will cause
const Y: u32 = foo(0-1);
//~^ WARN any use of this value will cause
println!("{} {}", X, Y);
//~^ ERROR evaluation of constant expression failed
//~| ERROR evaluation of constant expression failed
}
|