]>
Commit | Line | Data |
---|---|---|
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 | ||
9 | const X: u32 = 5; | |
10 | ||
a7813a04 | 11 | fn main() { |
0531ce1d XL |
12 | let x = X; |
13 | if x > 10 { | |
14 | println!("{}", x - 10); | |
15 | } else { | |
16 | println!("{}", 10 - x); | |
17 | } | |
54a0048b | 18 | } |