]> git.lizzy.rs Git - rust.git/blob - tests/ui/arithmetic.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / arithmetic.rs
1 #![feature(tool_lints)]
2
3
4 #![warn(clippy::integer_arithmetic, clippy::float_arithmetic)]
5 #![allow(unused, clippy::shadow_reuse, clippy::shadow_unrelated, clippy::no_effect, clippy::unnecessary_operation)]
6 fn main() {
7     let i = 1i32;
8     1 + i;
9     i * 2;
10     1 %
11     i / 2; // no error, this is part of the expression in the preceding line
12     i - 2 + 2 - i;
13     -i;
14
15     i & 1; // no wrapping
16     i | 1;
17     i ^ 1;
18     i >> 1;
19     i << 1;
20
21     let f = 1.0f32;
22
23     f * 2.0;
24
25     1.0 + f;
26     f * 2.0;
27     f / 2.0;
28     f - 2.0 * 4.2;
29     -f;
30 }