Skip to content

Commit f204398

Browse files
committed
ignore the lint on some test files
Signed-off-by: TennyZhuang <zty0826@gmail.com>
1 parent 081f739 commit f204398

20 files changed

+93
-81
lines changed

tests/ui/floating_point_exp.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::imprecise_flops)]
3+
#![allow(clippy::unnecessary_cast)]
34

45
fn main() {
56
let x = 2f32;

tests/ui/floating_point_exp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::imprecise_flops)]
3+
#![allow(clippy::unnecessary_cast)]
34

45
fn main() {
56
let x = 2f32;

tests/ui/floating_point_exp.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: (e.pow(x) - 1) can be computed more accurately
2-
--> $DIR/floating_point_exp.rs:6:13
2+
--> $DIR/floating_point_exp.rs:7:13
33
|
44
LL | let _ = x.exp() - 1.0;
55
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
66
|
77
= note: `-D clippy::imprecise-flops` implied by `-D warnings`
88

99
error: (e.pow(x) - 1) can be computed more accurately
10-
--> $DIR/floating_point_exp.rs:7:13
10+
--> $DIR/floating_point_exp.rs:8:13
1111
|
1212
LL | let _ = x.exp() - 1.0 + 2.0;
1313
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
1414

1515
error: (e.pow(x) - 1) can be computed more accurately
16-
--> $DIR/floating_point_exp.rs:8:13
16+
--> $DIR/floating_point_exp.rs:9:13
1717
|
1818
LL | let _ = (x as f32).exp() - 1.0 + 2.0;
1919
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).exp_m1()`
2020

2121
error: (e.pow(x) - 1) can be computed more accurately
22-
--> $DIR/floating_point_exp.rs:14:13
22+
--> $DIR/floating_point_exp.rs:15:13
2323
|
2424
LL | let _ = x.exp() - 1.0;
2525
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`
2626

2727
error: (e.pow(x) - 1) can be computed more accurately
28-
--> $DIR/floating_point_exp.rs:15:13
28+
--> $DIR/floating_point_exp.rs:16:13
2929
|
3030
LL | let _ = x.exp() - 1.0 + 2.0;
3131
| ^^^^^^^^^^^^^ help: consider using: `x.exp_m1()`

tests/ui/floating_point_log.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![allow(dead_code, clippy::double_parens)]
2+
#![allow(dead_code, clippy::double_parens, clippy::unnecessary_cast)]
33
#![warn(clippy::suboptimal_flops, clippy::imprecise_flops)]
44

55
const TWO: f32 = 2.0;

tests/ui/floating_point_log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![allow(dead_code, clippy::double_parens)]
2+
#![allow(dead_code, clippy::double_parens, clippy::unnecessary_cast)]
33
#![warn(clippy::suboptimal_flops, clippy::imprecise_flops)]
44

55
const TWO: f32 = 2.0;

tests/ui/floating_point_logbase.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::suboptimal_flops)]
3+
#![allow(clippy::unnecessary_cast)]
34

45
fn main() {
56
let x = 3f32;

tests/ui/floating_point_logbase.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::suboptimal_flops)]
3+
#![allow(clippy::unnecessary_cast)]
34

45
fn main() {
56
let x = 3f32;

tests/ui/floating_point_logbase.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: log base can be expressed more clearly
2-
--> $DIR/floating_point_logbase.rs:7:13
2+
--> $DIR/floating_point_logbase.rs:8:13
33
|
44
LL | let _ = x.ln() / y.ln();
55
| ^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
66
|
77
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
88

99
error: log base can be expressed more clearly
10-
--> $DIR/floating_point_logbase.rs:8:13
10+
--> $DIR/floating_point_logbase.rs:9:13
1111
|
1212
LL | let _ = (x as f32).ln() / y.ln();
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(x as f32).log(y)`
1414

1515
error: log base can be expressed more clearly
16-
--> $DIR/floating_point_logbase.rs:9:13
16+
--> $DIR/floating_point_logbase.rs:10:13
1717
|
1818
LL | let _ = x.log2() / y.log2();
1919
| ^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
2020

2121
error: log base can be expressed more clearly
22-
--> $DIR/floating_point_logbase.rs:10:13
22+
--> $DIR/floating_point_logbase.rs:11:13
2323
|
2424
LL | let _ = x.log10() / y.log10();
2525
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`
2626

2727
error: log base can be expressed more clearly
28-
--> $DIR/floating_point_logbase.rs:11:13
28+
--> $DIR/floating_point_logbase.rs:12:13
2929
|
3030
LL | let _ = x.log(5f32) / y.log(5f32);
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.log(y)`

tests/ui/floating_point_powf.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::suboptimal_flops, clippy::imprecise_flops)]
3+
#![allow(clippy::unnecessary_cast)]
34

45
fn main() {
56
let x = 3f32;

tests/ui/floating_point_powf.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-rustfix
22
#![warn(clippy::suboptimal_flops, clippy::imprecise_flops)]
3+
#![allow(clippy::unnecessary_cast)]
34

45
fn main() {
56
let x = 3f32;

0 commit comments

Comments
 (0)