]> git.lizzy.rs Git - rust.git/blob - tests/ui/arithmetic.rs
Move all our tests back to ui tests
[rust.git] / tests / ui / arithmetic.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3
4 #![warn(integer_arithmetic, float_arithmetic)]
5 #![allow(unused, shadow_reuse, shadow_unrelated, no_effect, 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 }