Skip to content

Commit 07c353b

Browse files
committed
Report fewer duplicate errors in tests
1 parent 656caf6 commit 07c353b

19 files changed

+24
-308
lines changed

tests/ui/associated-types/associated-types-eq-hr.stderr

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,6 @@ LL | tuple_one::<Tuple>();
6161
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
6262
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
6363

64-
error: implementation of `TheTrait` is not general enough
65-
--> $DIR/associated-types-eq-hr.rs:96:5
66-
|
67-
LL | tuple_one::<Tuple>();
68-
| ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
69-
|
70-
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
71-
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
72-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
73-
74-
error: implementation of `TheTrait` is not general enough
75-
--> $DIR/associated-types-eq-hr.rs:96:5
76-
|
77-
LL | tuple_one::<Tuple>();
78-
| ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
79-
|
80-
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
81-
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
82-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
83-
8464
error: implementation of `TheTrait` is not general enough
8565
--> $DIR/associated-types-eq-hr.rs:104:5
8666
|
@@ -90,16 +70,6 @@ LL | tuple_two::<Tuple>();
9070
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
9171
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
9272

93-
error: implementation of `TheTrait` is not general enough
94-
--> $DIR/associated-types-eq-hr.rs:104:5
95-
|
96-
LL | tuple_two::<Tuple>();
97-
| ^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
98-
|
99-
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
100-
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
101-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
102-
10373
error[E0308]: mismatched types
10474
--> $DIR/associated-types-eq-hr.rs:104:5
10575
|
@@ -114,21 +84,6 @@ note: the lifetime requirement is introduced here
11484
LL | T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>,
11585
| ^^^^^^^^^^^^^
11686

117-
error[E0308]: mismatched types
118-
--> $DIR/associated-types-eq-hr.rs:104:5
119-
|
120-
LL | tuple_two::<Tuple>();
121-
| ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
122-
|
123-
= note: expected reference `&'x _`
124-
found reference `&'y _`
125-
note: the lifetime requirement is introduced here
126-
--> $DIR/associated-types-eq-hr.rs:66:53
127-
|
128-
LL | T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'y isize>,
129-
| ^^^^^^^^^^^^^
130-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
131-
13287
error: implementation of `TheTrait` is not general enough
13388
--> $DIR/associated-types-eq-hr.rs:116:5
13489
|
@@ -138,17 +93,7 @@ LL | tuple_four::<Tuple>();
13893
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
13994
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
14095

141-
error: implementation of `TheTrait` is not general enough
142-
--> $DIR/associated-types-eq-hr.rs:116:5
143-
|
144-
LL | tuple_four::<Tuple>();
145-
| ^^^^^^^^^^^^^^^^^^^^^ implementation of `TheTrait` is not general enough
146-
|
147-
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
148-
= note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
149-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
150-
151-
error: aborting due to 12 previous errors
96+
error: aborting due to 7 previous errors
15297

15398
Some errors have detailed explanations: E0271, E0308.
15499
For more information about an error, try `rustc --explain E0271`.

tests/ui/async-await/drop-tracking-unresolved-typeck-results.no_assumptions.stderr

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,5 @@ LL | | });
99
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
1010
= note: ...but it actually implements `FnOnce<(&(),)>`
1111

12-
error: implementation of `FnOnce` is not general enough
13-
--> $DIR/drop-tracking-unresolved-typeck-results.rs:102:5
14-
|
15-
LL | / send(async {
16-
LL | | Next(&Buffered(Map(Empty(PhantomData), ready::<&()>), FuturesOrdered(PhantomData), 0)).await
17-
LL | | });
18-
| |______^ implementation of `FnOnce` is not general enough
19-
|
20-
= note: `fn(&'0 ()) -> std::future::Ready<&'0 ()> {std::future::ready::<&'0 ()>}` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
21-
= note: ...but it actually implements `FnOnce<(&(),)>`
22-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
23-
24-
error: aborting due to 2 previous errors
12+
error: aborting due to 1 previous error
2513

tests/ui/async-await/higher-ranked-auto-trait-1.no_assumptions.stderr

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,6 @@ LL | | }
1515
= note: no two async blocks, even if identical, have the same type
1616
= help: consider pinning your async block and casting it to a trait object
1717

18-
error[E0308]: mismatched types
19-
--> $DIR/higher-ranked-auto-trait-1.rs:37:5
20-
|
21-
LL | / async {
22-
LL | | let _y = &();
23-
LL | | let _x = filter(FilterMap {
24-
LL | | f: || async move { *_y },
25-
... |
26-
LL | | drop(_x);
27-
LL | | }
28-
| |_____^ one type is more general than the other
29-
|
30-
= note: expected `async` block `{async block@$DIR/higher-ranked-auto-trait-1.rs:40:19: 40:29}`
31-
found `async` block `{async block@$DIR/higher-ranked-auto-trait-1.rs:40:19: 40:29}`
32-
= note: no two async blocks, even if identical, have the same type
33-
= help: consider pinning your async block and casting it to a trait object
34-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
35-
36-
error: aborting due to 2 previous errors
18+
error: aborting due to 1 previous error
3719

3820
For more information about this error, try `rustc --explain E0308`.

tests/ui/async-await/higher-ranked-auto-trait-10.assumptions.stderr

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,5 @@ LL | Box::new(async move { get_foo(x).await })
77
= note: `Foo<'1>` would have to be implemented for the type `&'0 str`, for any two lifetimes `'0` and `'1`...
88
= note: ...but `Foo<'2>` is actually implemented for the type `&'2 str`, for some specific lifetime `'2`
99

10-
error: implementation of `Foo` is not general enough
11-
--> $DIR/higher-ranked-auto-trait-10.rs:32:5
12-
|
13-
LL | Box::new(async move { get_foo(x).await })
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
15-
|
16-
= note: `Foo<'1>` would have to be implemented for the type `&'0 str`, for any two lifetimes `'0` and `'1`...
17-
= note: ...but `Foo<'2>` is actually implemented for the type `&'2 str`, for some specific lifetime `'2`
18-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
19-
20-
error: aborting due to 2 previous errors
10+
error: aborting due to 1 previous error
2111

tests/ui/async-await/higher-ranked-auto-trait-10.no_assumptions.stderr

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,5 @@ LL | Box::new(async move { get_foo(x).await })
77
= note: `Foo<'1>` would have to be implemented for the type `&'0 str`, for any two lifetimes `'0` and `'1`...
88
= note: ...but `Foo<'2>` is actually implemented for the type `&'2 str`, for some specific lifetime `'2`
99

10-
error: implementation of `Foo` is not general enough
11-
--> $DIR/higher-ranked-auto-trait-10.rs:32:5
12-
|
13-
LL | Box::new(async move { get_foo(x).await })
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
15-
|
16-
= note: `Foo<'1>` would have to be implemented for the type `&'0 str`, for any two lifetimes `'0` and `'1`...
17-
= note: ...but `Foo<'2>` is actually implemented for the type `&'2 str`, for some specific lifetime `'2`
18-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
19-
20-
error: aborting due to 2 previous errors
10+
error: aborting due to 1 previous error
2111

tests/ui/async-await/higher-ranked-auto-trait-13.assumptions.stderr

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ LL | assert_send(my_send_async_method(struct_with_lifetime, data));
77
= note: `Getter<'_>` would have to be implemented for the type `GetterImpl<'0, ConstructableImpl<'1>>`, for any two lifetimes `'0` and `'1`...
88
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
99

10-
error: implementation of `Getter` is not general enough
11-
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
12-
|
13-
LL | assert_send(my_send_async_method(struct_with_lifetime, data));
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Getter` is not general enough
15-
|
16-
= note: `Getter<'1>` would have to be implemented for the type `GetterImpl<'0, ConstructableImpl<'_>>`, for any two lifetimes `'0` and `'1`...
17-
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
18-
1910
error: implementation of `Getter` is not general enough
2011
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
2112
|
@@ -26,15 +17,5 @@ LL | assert_send(my_send_async_method(struct_with_lifetime, data));
2617
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
2718
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2819

29-
error: implementation of `Getter` is not general enough
30-
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
31-
|
32-
LL | assert_send(my_send_async_method(struct_with_lifetime, data));
33-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Getter` is not general enough
34-
|
35-
= note: `Getter<'1>` would have to be implemented for the type `GetterImpl<'0, ConstructableImpl<'_>>`, for any two lifetimes `'0` and `'1`...
36-
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
37-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
38-
39-
error: aborting due to 4 previous errors
20+
error: aborting due to 2 previous errors
4021

tests/ui/async-await/higher-ranked-auto-trait-13.no_assumptions.stderr

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,6 @@ LL | assert_send(my_send_async_method(struct_with_lifetime, data));
77
= note: `Getter<'_>` would have to be implemented for the type `GetterImpl<'0, ConstructableImpl<'1>>`, for any two lifetimes `'0` and `'1`...
88
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
99

10-
error: implementation of `Getter` is not general enough
11-
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
12-
|
13-
LL | assert_send(my_send_async_method(struct_with_lifetime, data));
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Getter` is not general enough
15-
|
16-
= note: `Getter<'1>` would have to be implemented for the type `GetterImpl<'0, ConstructableImpl<'_>>`, for any two lifetimes `'0` and `'1`...
17-
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
18-
19-
error: implementation of `Callable` is not general enough
20-
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
21-
|
22-
LL | assert_send(my_send_async_method(struct_with_lifetime, data));
23-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Callable` is not general enough
24-
|
25-
= note: `Callable<'_>` would have to be implemented for the type `ConstructableImpl<'0>`, for any lifetime `'0`...
26-
= note: ...but `Callable<'1>` is actually implemented for the type `ConstructableImpl<'1>`, for some specific lifetime `'1`
27-
2810
error: implementation of `Getter` is not general enough
2911
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
3012
|
@@ -35,25 +17,5 @@ LL | assert_send(my_send_async_method(struct_with_lifetime, data));
3517
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
3618
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3719

38-
error: implementation of `Getter` is not general enough
39-
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
40-
|
41-
LL | assert_send(my_send_async_method(struct_with_lifetime, data));
42-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Getter` is not general enough
43-
|
44-
= note: `Getter<'1>` would have to be implemented for the type `GetterImpl<'0, ConstructableImpl<'_>>`, for any two lifetimes `'0` and `'1`...
45-
= note: ...but `Getter<'2>` is actually implemented for the type `GetterImpl<'2, ConstructableImpl<'_>>`, for some specific lifetime `'2`
46-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
47-
48-
error: implementation of `Callable` is not general enough
49-
--> $DIR/higher-ranked-auto-trait-13.rs:65:5
50-
|
51-
LL | assert_send(my_send_async_method(struct_with_lifetime, data));
52-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Callable` is not general enough
53-
|
54-
= note: `Callable<'_>` would have to be implemented for the type `ConstructableImpl<'0>`, for any lifetime `'0`...
55-
= note: ...but `Callable<'1>` is actually implemented for the type `ConstructableImpl<'1>`, for some specific lifetime `'1`
56-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
57-
58-
error: aborting due to 6 previous errors
20+
error: aborting due to 2 previous errors
5921

tests/ui/async-await/higher-ranked-auto-trait-15.no_assumptions.stderr

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,5 @@ LL | require_send(future);
77
= note: closure with signature `fn(&'0 Vec<i32>) -> std::slice::Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
88
= note: ...but it actually implements `FnOnce<(&Vec<i32>,)>`
99

10-
error: implementation of `FnOnce` is not general enough
11-
--> $DIR/higher-ranked-auto-trait-15.rs:20:5
12-
|
13-
LL | require_send(future);
14-
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
15-
|
16-
= note: closure with signature `fn(&'0 Vec<i32>) -> std::slice::Iter<'_, i32>` must implement `FnOnce<(&'1 Vec<i32>,)>`, for any two lifetimes `'0` and `'1`...
17-
= note: ...but it actually implements `FnOnce<(&Vec<i32>,)>`
18-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
19-
20-
error: aborting due to 2 previous errors
10+
error: aborting due to 1 previous error
2111

tests/ui/async-await/higher-ranked-auto-trait-17.no_assumptions.stderr

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,5 @@ LL | | }
1111
= note: closure with signature `fn(&'0 ())` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
1212
= note: ...but it actually implements `FnOnce<(&(),)>`
1313

14-
error: implementation of `FnOnce` is not general enough
15-
--> $DIR/higher-ranked-auto-trait-17.rs:12:5
16-
|
17-
LL | / async move {
18-
LL | | let iter = Adaptor::new(a.iter().map(|_: &()| {}));
19-
LL | | std::future::pending::<()>().await;
20-
LL | | drop(iter);
21-
LL | | }
22-
| |_____^ implementation of `FnOnce` is not general enough
23-
|
24-
= note: closure with signature `fn(&'0 ())` must implement `FnOnce<(&'1 (),)>`, for any two lifetimes `'0` and `'1`...
25-
= note: ...but it actually implements `FnOnce<(&(),)>`
26-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
27-
28-
error: aborting due to 2 previous errors
14+
error: aborting due to 1 previous error
2915

tests/ui/async-await/higher-ranked-auto-trait-6.no_assumptions.stderr

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ LL | Box::new(async { new(|| async { f().await }).await })
99
= note: no two async blocks, even if identical, have the same type
1010
= help: consider pinning your async block and casting it to a trait object
1111

12-
error[E0308]: mismatched types
13-
--> $DIR/higher-ranked-auto-trait-6.rs:16:5
14-
|
15-
LL | Box::new(async { new(|| async { f().await }).await })
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
17-
|
18-
= note: expected `async` block `{async block@$DIR/higher-ranked-auto-trait-6.rs:16:29: 16:34}`
19-
found `async` block `{async block@$DIR/higher-ranked-auto-trait-6.rs:16:29: 16:34}`
20-
= note: no two async blocks, even if identical, have the same type
21-
= help: consider pinning your async block and casting it to a trait object
22-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
23-
24-
error: aborting due to 2 previous errors
12+
error: aborting due to 1 previous error
2513

2614
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)