clean tests/ui/zero_div_zero.rs

Cleaning the empty lines for clarity.
This commit is contained in:
Luis de Bethencourt 2017-05-11 16:16:19 +01:00
parent b5a124bc27
commit 6f3679b8e4
3 changed files with 20 additions and 27 deletions

View File

@ -19,9 +19,6 @@ fn main() {
let t = &thingy;
match t.$idx { Foo::A(ref val) => { println!("42"); }, _ => {} }
}}
}

View File

@ -5,13 +5,9 @@
#[deny(zero_divided_by_zero)]
fn main() {
let nan = 0.0 / 0.0;
let f64_nan = 0.0 / 0.0f64;
let other_f64_nan = 0.0f64 / 0.0;
let one_more_f64_nan = 0.0f64/0.0f64;
let zero = 0.0;
let other_zero = 0.0;
let other_nan = zero / other_zero; // fine - this lint doesn't propegate constants.

View File

@ -20,49 +20,49 @@ note: lint level defined here
= help: Consider using `std::f32::NAN` if you would like a constant representing NaN
warning: equal expressions as operands to `/`
--> $DIR/zero_div_zero.rs:9:19
--> $DIR/zero_div_zero.rs:8:19
|
9 | let f64_nan = 0.0 / 0.0f64;
8 | let f64_nan = 0.0 / 0.0f64;
| ^^^^^^^^^^^^
|
= note: #[warn(eq_op)] on by default
error: constant division of 0.0 with 0.0 will always result in NaN
--> $DIR/zero_div_zero.rs:9:19
--> $DIR/zero_div_zero.rs:8:19
|
9 | let f64_nan = 0.0 / 0.0f64;
8 | let f64_nan = 0.0 / 0.0f64;
| ^^^^^^^^^^^^
|
= help: Consider using `std::f64::NAN` if you would like a constant representing NaN
warning: equal expressions as operands to `/`
--> $DIR/zero_div_zero.rs:11:25
|
11 | let other_f64_nan = 0.0f64 / 0.0;
| ^^^^^^^^^^^^
|
= note: #[warn(eq_op)] on by default
--> $DIR/zero_div_zero.rs:9:25
|
9 | let other_f64_nan = 0.0f64 / 0.0;
| ^^^^^^^^^^^^
|
= note: #[warn(eq_op)] on by default
error: constant division of 0.0 with 0.0 will always result in NaN
--> $DIR/zero_div_zero.rs:11:25
|
11 | let other_f64_nan = 0.0f64 / 0.0;
| ^^^^^^^^^^^^
|
= help: Consider using `std::f64::NAN` if you would like a constant representing NaN
--> $DIR/zero_div_zero.rs:9:25
|
9 | let other_f64_nan = 0.0f64 / 0.0;
| ^^^^^^^^^^^^
|
= help: Consider using `std::f64::NAN` if you would like a constant representing NaN
warning: equal expressions as operands to `/`
--> $DIR/zero_div_zero.rs:13:28
--> $DIR/zero_div_zero.rs:10:28
|
13 | let one_more_f64_nan = 0.0f64/0.0f64;
10 | let one_more_f64_nan = 0.0f64/0.0f64;
| ^^^^^^^^^^^^^
|
= note: #[warn(eq_op)] on by default
error: constant division of 0.0 with 0.0 will always result in NaN
--> $DIR/zero_div_zero.rs:13:28
--> $DIR/zero_div_zero.rs:10:28
|
13 | let one_more_f64_nan = 0.0f64/0.0f64;
10 | let one_more_f64_nan = 0.0f64/0.0f64;
| ^^^^^^^^^^^^^
|
= help: Consider using `std::f64::NAN` if you would like a constant representing NaN