4 #[allow(unused_variables)]
5 #[deny(zero_divided_by_zero)]
7 let nan = 0.0 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
8 //~^ equal expressions as operands to `/`
9 let f64_nan = 0.0 / 0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
10 //~^ equal expressions as operands to `/`
11 let other_f64_nan = 0.0f64 / 0.0; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
12 //~^ equal expressions as operands to `/`
13 let one_more_f64_nan = 0.0f64/0.0f64; //~ERROR constant division of 0.0 with 0.0 will always result in NaN
14 //~^ equal expressions as operands to `/`
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