Skip to content

Commit bba2c7f

Browse files
committed
Updated tests.
Removed unnecessary type repetition in float test and regenerated stderr Regenerated type_repetition stderr
1 parent 925e820 commit bba2c7f

File tree

3 files changed

+12
-22
lines changed

3 files changed

+12
-22
lines changed

tests/ui/float_cmp.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ const ONE: f32 = ZERO + 1.0;
88

99
fn twice<T>(x: T) -> T
1010
where
11-
T: Add<T, Output = T>,
12-
T: Copy,
11+
T: Add<T, Output = T> + Copy,
1312
{
1413
x + x
1514
}

tests/ui/float_cmp.stderr

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,39 @@
1-
error: this type has already been used as a bound predicate
2-
--> $DIR/float_cmp.rs:12:5
3-
|
4-
LL | T: Copy,
5-
| ^^^^^^^
6-
|
7-
= note: `-D clippy::type-repetition-in-bounds` implied by `-D warnings`
8-
= help: consider combining the bounds: `T: Add<T, Output = T>, Copy`
9-
101
error: strict comparison of f32 or f64
11-
--> $DIR/float_cmp.rs:60:5
2+
--> $DIR/float_cmp.rs:59:5
123
|
134
LL | ONE as f64 != 2.0;
145
| ^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(ONE as f64 - 2.0).abs() > error`
156
|
167
= note: `-D clippy::float-cmp` implied by `-D warnings`
178
note: std::f32::EPSILON and std::f64::EPSILON are available.
18-
--> $DIR/float_cmp.rs:60:5
9+
--> $DIR/float_cmp.rs:59:5
1910
|
2011
LL | ONE as f64 != 2.0;
2112
| ^^^^^^^^^^^^^^^^^
2213

2314
error: strict comparison of f32 or f64
24-
--> $DIR/float_cmp.rs:65:5
15+
--> $DIR/float_cmp.rs:64:5
2516
|
2617
LL | x == 1.0;
2718
| ^^^^^^^^ help: consider comparing them within some error: `(x - 1.0).abs() < error`
2819
|
2920
note: std::f32::EPSILON and std::f64::EPSILON are available.
30-
--> $DIR/float_cmp.rs:65:5
21+
--> $DIR/float_cmp.rs:64:5
3122
|
3223
LL | x == 1.0;
3324
| ^^^^^^^^
3425

3526
error: strict comparison of f32 or f64
36-
--> $DIR/float_cmp.rs:68:5
27+
--> $DIR/float_cmp.rs:67:5
3728
|
3829
LL | twice(x) != twice(ONE as f64);
3930
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider comparing them within some error: `(twice(x) - twice(ONE as f64)).abs() > error`
4031
|
4132
note: std::f32::EPSILON and std::f64::EPSILON are available.
42-
--> $DIR/float_cmp.rs:68:5
33+
--> $DIR/float_cmp.rs:67:5
4334
|
4435
LL | twice(x) != twice(ONE as f64);
4536
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4637

47-
error: aborting due to 4 previous errors
38+
error: aborting due to 3 previous errors
4839

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error: this type has already been used as a bound predicate
2-
--> $DIR/type_repetition_in_bounds.rs:3:37
2+
--> $DIR/type_repetition_in_bounds.rs:6:5
33
|
4-
LL | pub fn foo<T>(_t: T) where T: Copy, T: Clone {
5-
| ^^^^^^^^
4+
LL | T: Clone,
5+
| ^^^^^^^^
66
|
77
note: lint level defined here
88
--> $DIR/type_repetition_in_bounds.rs:1:8
99
|
1010
LL | #[deny(clippy::type_repetition_in_bounds)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12-
= help: consider combining the bounds: `T: Copy, Clone`
12+
= help: consider combining the bounds: `T: Copy + Clone`
1313

1414
error: aborting due to previous error
1515

0 commit comments

Comments
 (0)