Skip to content

Commit 2541c5b

Browse files
committed
Erase regions in default main E0277 message
1 parent 3ea12d4 commit 2541c5b

File tree

47 files changed

+83
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+83
-77
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,17 +2941,23 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
29412941
}
29422942
})
29432943
.unwrap_or_else(|| {
2944-
if let ty::ImplPolarity::Positive = trait_predicate.polarity() {
2944+
let pred = self.tcx.erase_regions(if self.tcx.features().non_lifetime_binders {
2945+
// We can't erase the lifetime bounds on their own when this feature is enabled.
2946+
// `instantiate_bound_regions_with_erased` expects there to be no type bounds.
2947+
trait_predicate.skip_binder()
2948+
} else {
2949+
self.tcx.instantiate_bound_regions_with_erased(*trait_predicate)
2950+
});
2951+
if let ty::ImplPolarity::Positive = pred.polarity {
29452952
format!(
29462953
"the trait `{}` is not implemented for `{}`{post_message}",
2947-
trait_predicate.print_modifiers_and_trait_path(),
2948-
self.tcx
2949-
.short_ty_string(trait_predicate.skip_binder().self_ty(), &mut None),
2954+
pred.print_modifiers_and_trait_path(),
2955+
self.tcx.short_ty_string(pred.self_ty(), &mut None),
29502956
)
29512957
} else {
29522958
// "the trait bound `!Send: T` is not satisfied" reads better than "`!Send` is
29532959
// not implemented for `T`".
2954-
format!("the trait bound `{trait_predicate}` is not satisfied{post_message}")
2960+
format!("the trait bound `{pred}` is not satisfied{post_message}")
29552961
}
29562962
})
29572963
}

tests/ui/associated-types/hr-associated-type-bound-object.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ where
55
type U: ?Sized;
66
}
77
fn f<'a, T: X<'a> + ?Sized>(x: &<T as X<'a>>::U) {
8-
//~^ ERROR trait `for<'b> Clone` is not implemented for `<T as X<'b>>::U`
8+
//~^ ERROR trait `Clone` is not implemented for `<T as X<'_>>::U`
99
<<T as X<'_>>::U>::clone(x);
10-
//~^ ERROR trait `for<'b> Clone` is not implemented for `<T as X<'b>>::U`
11-
//~| ERROR trait `for<'b> Clone` is not implemented for `<T as X<'b>>::U`
10+
//~^ ERROR trait `Clone` is not implemented for `<T as X<'_>>::U`
11+
//~| ERROR trait `Clone` is not implemented for `<T as X<'_>>::U`
1212
//~| ERROR trait `Clone` is not implemented for `<T as X<'_>>::U`
1313
}
1414

tests/ui/associated-types/hr-associated-type-bound-object.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'b> Clone` is not implemented for `<T as X<'b>>::U`
1+
error[E0277]: the trait `Clone` is not implemented for `<T as X<'_>>::U`
22
--> $DIR/hr-associated-type-bound-object.rs:7:13
33
|
44
LL | fn f<'a, T: X<'a> + ?Sized>(x: &<T as X<'a>>::U) {
@@ -17,7 +17,7 @@ help: consider further restricting the associated type
1717
LL | fn f<'a, T: X<'a> + ?Sized>(x: &<T as X<'a>>::U) where for<'b> <T as X<'b>>::U: Clone {
1818
| ++++++++++++++++++++++++++++++++++++
1919

20-
error[E0277]: the trait `for<'b> Clone` is not implemented for `<T as X<'b>>::U`
20+
error[E0277]: the trait `Clone` is not implemented for `<T as X<'_>>::U`
2121
--> $DIR/hr-associated-type-bound-object.rs:9:7
2222
|
2323
LL | <<T as X<'_>>::U>::clone(x);
@@ -47,7 +47,7 @@ help: consider further restricting the associated type
4747
LL | fn f<'a, T: X<'a> + ?Sized>(x: &<T as X<'a>>::U) where <T as X<'_>>::U: Clone {
4848
| ++++++++++++++++++++++++++++
4949

50-
error[E0277]: the trait `for<'b> Clone` is not implemented for `<T as X<'b>>::U`
50+
error[E0277]: the trait `Clone` is not implemented for `<T as X<'_>>::U`
5151
--> $DIR/hr-associated-type-bound-object.rs:9:5
5252
|
5353
LL | <<T as X<'_>>::U>::clone(x);

tests/ui/associated-types/hr-associated-type-bound-param-6.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ where
1010
}
1111

1212
impl<S, T> X<'_, T> for (S,) {
13-
//~^ ERROR trait `for<'b> X<'b, T>` is not implemented for `T`
13+
//~^ ERROR trait `X<'_, T>` is not implemented for `T`
1414
type U = str;
1515
}
1616

1717
pub fn main() {
1818
<(i32,) as X<i32>>::f("abc");
1919
//~^ ERROR trait `X<'_, i32>` is not implemented for `i32`
20-
//~| ERROR trait `for<'b> X<'b, i32>` is not implemented for `i32`
20+
//~| ERROR trait `X<'_, i32>` is not implemented for `i32`
2121
}

tests/ui/associated-types/hr-associated-type-bound-param-6.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'b> X<'b, T>` is not implemented for `T`
1+
error[E0277]: the trait `X<'_, T>` is not implemented for `T`
22
--> $DIR/hr-associated-type-bound-param-6.rs:12:12
33
|
44
LL | impl<S, T> X<'_, T> for (S,) {
@@ -9,7 +9,7 @@ help: consider restricting type parameter `T`
99
LL | impl<S, T: for<'b> X<'b, T>> X<'_, T> for (S,) {
1010
| ++++++++++++++++++
1111

12-
error[E0277]: the trait `for<'b> X<'b, i32>` is not implemented for `i32`
12+
error[E0277]: the trait `X<'_, i32>` is not implemented for `i32`
1313
--> $DIR/hr-associated-type-bound-param-6.rs:18:5
1414
|
1515
LL | <(i32,) as X<i32>>::f("abc");

tests/ui/associated-types/issue-43924.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
trait Foo<T: Default + ToString> {
77
type Out: Default + ToString + ?Sized = dyn ToString;
8-
//~^ ERROR the trait `Default` is not implemented for `(dyn ToString + 'static)`
8+
//~^ ERROR the trait `Default` is not implemented for `dyn ToString`
99
}
1010

1111
impl Foo<u32> for () {}

tests/ui/associated-types/issue-43924.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `Default` is not implemented for `(dyn ToString + 'static)`
1+
error[E0277]: the trait `Default` is not implemented for `dyn ToString`
22
--> $DIR/issue-43924.rs:7:45
33
|
44
LL | type Out: Default + ToString + ?Sized = dyn ToString;

tests/ui/for/issue-20605.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
1+
error[E0277]: the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &mut u8>`
22
--> $DIR/issue-20605.rs:5:17
33
|
44
LL | for item in *things { *item = 0 }

tests/ui/for/issue-20605.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fn changer<'a>(mut things: Box<dyn Iterator<Item=&'a mut u8>>) {
55
for item in *things { *item = 0 }
66
//[current]~^ ERROR the size for values of type
7-
//[next]~^^ ERROR the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
7+
//[next]~^^ ERROR the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &mut u8>`
88
//[next]~| ERROR the type `<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not well-formed
99
//[next]~| ERROR the type `&mut <dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter` is not well-formed
1010
//[next]~| ERROR the type `Option<<<dyn Iterator<Item = &'a mut u8> as IntoIterator>::IntoIter as Iterator>::Item>` is not well-formed

tests/ui/generic-associated-types/issue-101020.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ trait Foo<T> {}
2929

3030
fn map_test() {
3131
(&mut EmptyIter).consume(());
32-
//~^ ERROR trait `for<'a> Foo<&'a mut ()>` is not implemented for `&'a mut ()`
32+
//~^ ERROR trait `Foo<&mut ()>` is not implemented for `&mut ()`
3333
}
3434

3535
fn main() {}

tests/ui/generic-associated-types/issue-101020.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'a> Foo<&'a mut ()>` is not implemented for `&'a mut ()`
1+
error[E0277]: the trait `Foo<&mut ()>` is not implemented for `&mut ()`
22
--> $DIR/issue-101020.rs:31:22
33
|
44
LL | (&mut EmptyIter).consume(());

tests/ui/generic-associated-types/unknown-lifetime-ice-119827.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ impl Foo for Box<dyn Foo> {}
1010
//~| ERROR cycle detected
1111
//~| ERROR cycle detected
1212
//~| ERROR cycle detected
13-
//~| ERROR trait `Foo` is not implemented for `Box<(dyn Foo + 'static)>`
13+
//~| ERROR trait `Foo` is not implemented for `Box<dyn Foo>`
1414
//~| ERROR not all trait items implemented
1515

1616
fn main() {}

tests/ui/generic-associated-types/unknown-lifetime-ice-119827.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ LL | type Context<'c>
8080
= help: consider moving `Context` to another trait
8181
= help: only type `{type error}` implements the trait, consider using it directly instead
8282

83-
error[E0277]: the trait `Foo` is not implemented for `Box<(dyn Foo + 'static)>`
83+
error[E0277]: the trait `Foo` is not implemented for `Box<dyn Foo>`
8484
--> $DIR/unknown-lifetime-ice-119827.rs:7:14
8585
|
8686
LL | impl Foo for Box<dyn Foo> {}

tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
1+
error[E0277]: the trait `Bar<'_>` is not implemented for `B`
22
--> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:26
33
|
44
LL | want_bar_for_any_ccx(b);

tests/ui/higher-ranked/trait-bounds/hrtb-higher-ranker-supertraits.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
1+
error[E0277]: the trait `Foo<'_>` is not implemented for `F`
22
--> $DIR/hrtb-higher-ranker-supertraits.rs:18:26
33
|
44
LL | want_foo_for_any_tcx(f);
@@ -18,7 +18,7 @@ help: consider further restricting this bound
1818
LL | where F : Foo<'x> + for<'tcx> Foo<'tcx>
1919
| +++++++++++++++++++++
2020

21-
error[E0277]: the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
21+
error[E0277]: the trait `Bar<'_>` is not implemented for `B`
2222
--> $DIR/hrtb-higher-ranker-supertraits.rs:35:26
2323
|
2424
LL | want_bar_for_any_ccx(b);

tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ trait SomeTrait<'a> {
66

77
fn give_me_ice<T>() {
88
callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
9-
//~^ ERROR trait `for<'a> SomeTrait<'a>` is not implemented for `T`
10-
//~| ERROR trait `for<'a> SomeTrait<'a>` is not implemented for `T`
9+
//~^ ERROR trait `SomeTrait<'_>` is not implemented for `T`
10+
//~| ERROR trait `SomeTrait<'_>` is not implemented for `T`
1111
}
1212

1313
fn callee<T: Fn<(&'static (),)>>() {

tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-85455.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'a> SomeTrait<'a>` is not implemented for `T`
1+
error[E0277]: the trait `SomeTrait<'_>` is not implemented for `T`
22
--> $DIR/issue-85455.rs:8:14
33
|
44
LL | callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
@@ -9,7 +9,7 @@ help: consider restricting type parameter `T`
99
LL | fn give_me_ice<T: for<'a> SomeTrait<'a>>() {
1010
| +++++++++++++++++++++++
1111

12-
error[E0277]: the trait `for<'a> SomeTrait<'a>` is not implemented for `T`
12+
error[E0277]: the trait `SomeTrait<'_>` is not implemented for `T`
1313
--> $DIR/issue-85455.rs:8:5
1414
|
1515
LL | callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();

tests/ui/higher-ranked/trait-bounds/normalize-under-binder/issue-89118.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'a> BufferMut` is not implemented for `&'a ()`
1+
error[E0277]: the trait `BufferMut` is not implemented for `&()`
22
--> $DIR/issue-89118.rs:19:8
33
|
44
LL | C: StackContext,
@@ -25,7 +25,7 @@ LL | where
2525
LL | Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>,
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StackContext`
2727

28-
error[E0277]: the trait `for<'a> BufferMut` is not implemented for `&'a ()`
28+
error[E0277]: the trait `BufferMut` is not implemented for `&()`
2929
--> $DIR/issue-89118.rs:29:9
3030
|
3131
LL | impl<C> EthernetWorker<C> {}
@@ -52,7 +52,7 @@ LL | where
5252
LL | Ctx<()>: for<'a> BufferUdpStateContext<&'a ()>;
5353
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `EthernetWorker`
5454

55-
error[E0277]: the trait `for<'a> BufferMut` is not implemented for `&'a ()`
55+
error[E0277]: the trait `BufferMut` is not implemented for `&()`
5656
--> $DIR/issue-89118.rs:22:20
5757
|
5858
LL | type Handler = Ctx<C::Dispatcher>;

tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()`
1+
error[E0277]: the trait `AsRef<dyn for<'a> Fn(&'a ())>` is not implemented for `()`
22
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13
33
|
44
LL | fn ice() -> impl AsRef<Fn(&())> {

tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()`
1+
error[E0277]: the trait `AsRef<dyn for<'a> Fn(&'a ())>` is not implemented for `()`
22
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13
33
|
44
LL | fn ice() -> impl AsRef<Fn(&())> {

tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#![allow(warnings)]
55

66
fn ice() -> impl AsRef<Fn(&())> {
7-
//[edition2015]~^ ERROR trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()`
7+
//[edition2015]~^ ERROR trait `AsRef<dyn for<'a> Fn(&'a ())>` is not implemented for `()`
88
//[edition2021]~^^ ERROR: trait objects must include the `dyn` keyword [E0782]
9-
//[edition2021]~| ERROR trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()`
9+
//[edition2021]~| ERROR trait `AsRef<dyn for<'a> Fn(&'a ())>` is not implemented for `()`
1010
todo!()
1111
}
1212

tests/ui/impl-trait/nested-rpit-hrtb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn one_hrtb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl Sized + 'a> {}
3535

3636
fn one_hrtb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl Qux<'a>> {}
3737
//~^ ERROR higher kinded lifetime bounds on nested opaque types are not supported yet
38-
//~| ERROR trait `for<'a> Qux<'_>` is not implemented for `&'a ()`
38+
//~| ERROR trait `Qux<'_>` is not implemented for `&()`
3939

4040
// This should resolve.
4141
fn one_hrtb_mention_fn_trait_param<'b>() -> impl for<'a> Foo<'a, Assoc = impl Qux<'b>> {}
@@ -45,7 +45,7 @@ fn one_hrtb_mention_fn_outlives<'b>() -> impl for<'a> Foo<'a, Assoc = impl Sized
4545

4646
// This should resolve.
4747
fn one_hrtb_mention_fn_trait_param_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Qux<'b>> {}
48-
//~^ ERROR trait `for<'a> Qux<'b>` is not implemented for `&'a ()`
48+
//~^ ERROR trait `Qux<'_>` is not implemented for `&()`
4949

5050
// This should resolve.
5151
fn one_hrtb_mention_fn_outlives_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Sized + 'b> {}
@@ -60,7 +60,7 @@ fn two_htrb_outlives() -> impl for<'a> Foo<'a, Assoc = impl for<'b> Sized + 'b>
6060

6161
// This should resolve.
6262
fn two_htrb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Qux<'b>> {}
63-
//~^ ERROR trait `for<'a, 'b> Qux<'b>` is not implemented for `&'a ()`
63+
//~^ ERROR trait `Qux<'_>` is not implemented for `&()`
6464

6565
// `'b` is not in scope for the outlives bound.
6666
fn two_htrb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Sized + 'b> {}

tests/ui/impl-trait/nested-rpit-hrtb.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ LL | fn one_hrtb_outlives_uses() -> impl for<'a> Bar<'a, Assoc = impl Sized + 'a
8686
= note: `()` must implement `Bar<'a>`
8787
= note: ...but it actually implements `Bar<'0>`, for some specific lifetime `'0`
8888

89-
error[E0277]: the trait `for<'a> Qux<'_>` is not implemented for `&'a ()`
89+
error[E0277]: the trait `Qux<'_>` is not implemented for `&()`
9090
--> $DIR/nested-rpit-hrtb.rs:36:64
9191
|
9292
LL | fn one_hrtb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl Qux<'a>> {}
@@ -95,7 +95,7 @@ LL | fn one_hrtb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl Qux<'a>
9595
= help: the trait `Qux<'_>` is implemented for `()`
9696
= help: for that trait implementation, expected `()`, found `&'a ()`
9797

98-
error[E0277]: the trait `for<'a> Qux<'b>` is not implemented for `&'a ()`
98+
error[E0277]: the trait `Qux<'_>` is not implemented for `&()`
9999
--> $DIR/nested-rpit-hrtb.rs:47:79
100100
|
101101
LL | fn one_hrtb_mention_fn_trait_param_uses<'b>() -> impl for<'a> Bar<'a, Assoc = impl Qux<'b>> {}
@@ -113,7 +113,7 @@ LL | fn one_hrtb_mention_fn_outlives_uses<'b>() -> impl for<'a> Bar<'a, Assoc =
113113
= note: `()` must implement `Bar<'a>`
114114
= note: ...but it actually implements `Bar<'0>`, for some specific lifetime `'0`
115115

116-
error[E0277]: the trait `for<'a, 'b> Qux<'b>` is not implemented for `&'a ()`
116+
error[E0277]: the trait `Qux<'_>` is not implemented for `&()`
117117
--> $DIR/nested-rpit-hrtb.rs:62:64
118118
|
119119
LL | fn two_htrb_trait_param_uses() -> impl for<'a> Bar<'a, Assoc = impl for<'b> Qux<'b>> {}

tests/ui/issues/issue-35570.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ trait Trait2<'a> {
66
}
77

88
fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
9-
//~^ ERROR trait `for<'a> Trait2<'a>` is not implemented for `()`
10-
//~| ERROR trait `for<'a> Trait2<'a>` is not implemented for `()`
9+
//~^ ERROR trait `Trait2<'_>` is not implemented for `()`
10+
//~| ERROR trait `Trait2<'_>` is not implemented for `()`
1111
let _e: (usize, usize) = unsafe{mem::transmute(param)};
1212
}
1313

tests/ui/issues/issue-35570.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'a> Trait2<'a>` is not implemented for `()`
1+
error[E0277]: the trait `Trait2<'_>` is not implemented for `()`
22
--> $DIR/issue-35570.rs:8:40
33
|
44
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
@@ -10,7 +10,7 @@ help: this trait has no implementations, consider adding one
1010
LL | trait Trait2<'a> {
1111
| ^^^^^^^^^^^^^^^^
1212

13-
error[E0277]: the trait `for<'a> Trait2<'a>` is not implemented for `()`
13+
error[E0277]: the trait `Trait2<'_>` is not implemented for `()`
1414
--> $DIR/issue-35570.rs:8:66
1515
|
1616
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {

tests/ui/kindck/kindck-copy.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `Copy` is not implemented for `&'static mut isize`
1+
error[E0277]: the trait `Copy` is not implemented for `&mut isize`
22
--> $DIR/kindck-copy.rs:27:19
33
|
44
LL | assert_copy::<&'static mut isize>();
@@ -15,7 +15,7 @@ LL - assert_copy::<&'static mut isize>();
1515
LL + assert_copy::<isize>();
1616
|
1717

18-
error[E0277]: the trait `Copy` is not implemented for `&'a mut isize`
18+
error[E0277]: the trait `Copy` is not implemented for `&mut isize`
1919
--> $DIR/kindck-copy.rs:28:19
2020
|
2121
LL | assert_copy::<&'a mut isize>();
@@ -68,7 +68,7 @@ note: required by a bound in `assert_copy`
6868
LL | fn assert_copy<T:Copy>() { }
6969
| ^^^^ required by this bound in `assert_copy`
7070

71-
error[E0277]: the trait `Copy` is not implemented for `Box<&'a mut isize>`
71+
error[E0277]: the trait `Copy` is not implemented for `Box<&mut isize>`
7272
--> $DIR/kindck-copy.rs:34:19
7373
|
7474
LL | assert_copy::<Box<&'a mut isize>>();
@@ -104,7 +104,7 @@ note: required by a bound in `assert_copy`
104104
LL | fn assert_copy<T:Copy>() { }
105105
| ^^^^ required by this bound in `assert_copy`
106106

107-
error[E0277]: the trait `Copy` is not implemented for `&'a mut (dyn Dummy + Send + 'a)`
107+
error[E0277]: the trait `Copy` is not implemented for `&mut dyn Dummy + Send`
108108
--> $DIR/kindck-copy.rs:46:19
109109
|
110110
LL | assert_copy::<&'a mut (dyn Dummy + Send)>();

tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ trait Trait2<'a, 'b> {
1919
// since for it to be WF, we would need to know that `'y: 'x`, but we
2020
// do not infer that.
2121
fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
22-
//~^ ERROR trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
22+
//~^ ERROR trait `Trait2<'_, '_>` is not implemented for `T`
2323
{
24-
//~^ ERROR trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
24+
//~^ ERROR trait `Trait2<'_, '_>` is not implemented for `T`
2525
}
2626

2727
fn main() { }

tests/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
1+
error[E0277]: the trait `Trait2<'_, '_>` is not implemented for `T`
22
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:49
33
|
44
LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
@@ -9,7 +9,7 @@ help: consider restricting type parameter `T`
99
LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
1010
| ++++++++++++++++++++++++
1111

12-
error[E0277]: the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
12+
error[E0277]: the trait `Trait2<'_, '_>` is not implemented for `T`
1313
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:23:1
1414
|
1515
LL | / {

0 commit comments

Comments
 (0)