1
1
error: multiply and add expressions can be calculated more efficiently and accurately
2
- --> tests/ui/floating_point_mul_add.rs:20 :13
2
+ --> tests/ui/floating_point_mul_add.rs:19 :13
3
3
|
4
4
LL | let _ = a * b + c;
5
5
| ^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
@@ -8,73 +8,73 @@ LL | let _ = a * b + c;
8
8
= help: to override `-D warnings` add `#[allow(clippy::suboptimal_flops)]`
9
9
10
10
error: multiply and add expressions can be calculated more efficiently and accurately
11
- --> tests/ui/floating_point_mul_add.rs:21 :13
11
+ --> tests/ui/floating_point_mul_add.rs:20 :13
12
12
|
13
13
LL | let _ = a * b - c;
14
14
| ^^^^^^^^^ help: consider using: `a.mul_add(b, -c)`
15
15
16
16
error: multiply and add expressions can be calculated more efficiently and accurately
17
- --> tests/ui/floating_point_mul_add.rs:22 :13
17
+ --> tests/ui/floating_point_mul_add.rs:21 :13
18
18
|
19
19
LL | let _ = c + a * b;
20
20
| ^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
21
21
22
22
error: multiply and add expressions can be calculated more efficiently and accurately
23
- --> tests/ui/floating_point_mul_add.rs:23 :13
23
+ --> tests/ui/floating_point_mul_add.rs:22 :13
24
24
|
25
25
LL | let _ = c - a * b;
26
26
| ^^^^^^^^^ help: consider using: `a.mul_add(-b, c)`
27
27
28
28
error: multiply and add expressions can be calculated more efficiently and accurately
29
- --> tests/ui/floating_point_mul_add.rs:24 :13
29
+ --> tests/ui/floating_point_mul_add.rs:23 :13
30
30
|
31
31
LL | let _ = a + 2.0 * 4.0;
32
32
| ^^^^^^^^^^^^^ help: consider using: `2.0f64.mul_add(4.0, a)`
33
33
34
34
error: multiply and add expressions can be calculated more efficiently and accurately
35
- --> tests/ui/floating_point_mul_add.rs:25 :13
35
+ --> tests/ui/floating_point_mul_add.rs:24 :13
36
36
|
37
37
LL | let _ = a + 2. * 4.;
38
38
| ^^^^^^^^^^^ help: consider using: `2.0f64.mul_add(4., a)`
39
39
40
40
error: multiply and add expressions can be calculated more efficiently and accurately
41
- --> tests/ui/floating_point_mul_add.rs:27 :13
41
+ --> tests/ui/floating_point_mul_add.rs:26 :13
42
42
|
43
43
LL | let _ = (a * b) + c;
44
44
| ^^^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
45
45
46
46
error: multiply and add expressions can be calculated more efficiently and accurately
47
- --> tests/ui/floating_point_mul_add.rs:28 :13
47
+ --> tests/ui/floating_point_mul_add.rs:27 :13
48
48
|
49
49
LL | let _ = c + (a * b);
50
50
| ^^^^^^^^^^^ help: consider using: `a.mul_add(b, c)`
51
51
52
52
error: multiply and add expressions can be calculated more efficiently and accurately
53
- --> tests/ui/floating_point_mul_add.rs:29 :13
53
+ --> tests/ui/floating_point_mul_add.rs:28 :13
54
54
|
55
55
LL | let _ = a * b * c + d;
56
56
| ^^^^^^^^^^^^^ help: consider using: `(a * b).mul_add(c, d)`
57
57
58
58
error: multiply and add expressions can be calculated more efficiently and accurately
59
- --> tests/ui/floating_point_mul_add.rs:31 :13
59
+ --> tests/ui/floating_point_mul_add.rs:30 :13
60
60
|
61
61
LL | let _ = a.mul_add(b, c) * a.mul_add(b, c) + a.mul_add(b, c) + c;
62
62
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `a.mul_add(b, c).mul_add(a.mul_add(b, c), a.mul_add(b, c))`
63
63
64
64
error: multiply and add expressions can be calculated more efficiently and accurately
65
- --> tests/ui/floating_point_mul_add.rs:32 :13
65
+ --> tests/ui/floating_point_mul_add.rs:31 :13
66
66
|
67
67
LL | let _ = 1234.567_f64 * 45.67834_f64 + 0.0004_f64;
68
68
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `1234.567_f64.mul_add(45.67834_f64, 0.0004_f64)`
69
69
70
70
error: multiply and add expressions can be calculated more efficiently and accurately
71
- --> tests/ui/floating_point_mul_add.rs:34 :13
71
+ --> tests/ui/floating_point_mul_add.rs:33 :13
72
72
|
73
73
LL | let _ = (a * a + b).sqrt();
74
74
| ^^^^^^^^^^^ help: consider using: `a.mul_add(a, b)`
75
75
76
76
error: multiply and add expressions can be calculated more efficiently and accurately
77
- --> tests/ui/floating_point_mul_add.rs:37 :13
77
+ --> tests/ui/floating_point_mul_add.rs:36 :13
78
78
|
79
79
LL | let _ = a - (b * u as f64);
80
80
| ^^^^^^^^^^^^^^^^^^ help: consider using: `b.mul_add(-(u as f64), a)`
0 commit comments