]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/issue-43197.rs
Remove licenses
[rust.git] / src / test / ui / consts / const-eval / issue-43197.rs
1 #![warn(const_err)]
2
3 const fn foo(x: u32) -> u32 {
4     x
5 }
6
7 fn main() {
8     const X: u32 = 0-1;
9     //~^ WARN any use of this value will cause
10     const Y: u32 = foo(0-1);
11     //~^ WARN any use of this value will cause
12     println!("{} {}", X, Y);
13     //~^ ERROR evaluation of constant expression failed
14     //~| ERROR evaluation of constant expression failed
15 }