]> git.lizzy.rs Git - rust.git/blob - tests/ui/zero_div_zero.rs
remove all //~ from tests
[rust.git] / tests / ui / zero_div_zero.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3
4 #[allow(unused_variables)]
5 #[deny(zero_divided_by_zero)]
6 fn main() {
7     let nan = 0.0 / 0.0;
8
9     let f64_nan = 0.0 / 0.0f64;
10
11     let other_f64_nan = 0.0f64 / 0.0;
12
13     let one_more_f64_nan = 0.0f64/0.0f64;
14
15     let zero = 0.0;
16     let other_zero = 0.0;
17     let other_nan = zero / other_zero; // fine - this lint doesn't propegate constants.
18     let not_nan = 2.0/0.0; // not an error: 2/0 = inf
19     let also_not_nan = 0.0/2.0; // not an error: 0/2 = 0
20 }