]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/const-eval/no_lint_for_statically_known_error.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / consts / const-eval / no_lint_for_statically_known_error.rs
CommitLineData
ba9703b0 1// check-pass
0531ce1d
XL
2
3// if `X` were used instead of `x`, `X - 10` would result in a lint.
4// This file should never produce a lint, no matter how the const
5// propagator is improved.
6
7#![deny(warnings)]
8
9const X: u32 = 5;
10
a7813a04 11fn main() {
0531ce1d
XL
12 let x = X;
13 if x > 10 {
14 println!("{}", x - 10);
15 } else {
16 println!("{}", 10 - x);
17 }
54a0048b 18}