mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 01:13:11 +00:00
Keep existing names of regions in placeholder_error
This commit is contained in:
parent
9337d4fde8
commit
f852160a99
@ -118,9 +118,9 @@ impl NiceRegionError<'me, 'tcx> {
|
||||
sub_region @ ty::RePlaceholder(_),
|
||||
sup_region,
|
||||
)) => self.try_report_trait_placeholder_mismatch(
|
||||
Some(sup_region),
|
||||
(!sup_region.has_name()).then_some(sup_region),
|
||||
cause,
|
||||
Some(*sub_region),
|
||||
Some(sub_region),
|
||||
None,
|
||||
values,
|
||||
),
|
||||
@ -130,10 +130,10 @@ impl NiceRegionError<'me, 'tcx> {
|
||||
sub_region,
|
||||
sup_region @ ty::RePlaceholder(_),
|
||||
)) => self.try_report_trait_placeholder_mismatch(
|
||||
Some(sub_region),
|
||||
(!sub_region.has_name()).then_some(sub_region),
|
||||
cause,
|
||||
None,
|
||||
Some(*sup_region),
|
||||
Some(sup_region),
|
||||
values,
|
||||
),
|
||||
|
||||
|
@ -4,8 +4,8 @@ error: implementation of `Foo` is not general enough
|
||||
LL | assert_foo(gen);
|
||||
| ^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
|
|
||||
= note: `Foo` would have to be implemented for the type `&'0 OnlyFooIfStaticRef`, for any lifetime `'0`...
|
||||
= note: ...but `Foo` is actually implemented for the type `&'1 OnlyFooIfStaticRef`, for some specific lifetime `'1`
|
||||
= note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
|
||||
= note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/auto-trait-regions.rs:31:5
|
||||
@ -13,8 +13,8 @@ error: implementation of `Foo` is not general enough
|
||||
LL | assert_foo(gen);
|
||||
| ^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
|
|
||||
= note: `Foo` would have to be implemented for the type `&'0 OnlyFooIfStaticRef`, for any lifetime `'0`...
|
||||
= note: ...but `Foo` is actually implemented for the type `&'1 OnlyFooIfStaticRef`, for some specific lifetime `'1`
|
||||
= note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
|
||||
= note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/auto-trait-regions.rs:50:5
|
||||
|
@ -5,7 +5,7 @@ LL | want_hrtb::<StaticInt>()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
||||
|
|
||||
= note: `StaticInt` must implement `Foo<&'0 isize>`, for any lifetime `'0`...
|
||||
= note: ...but it actually implements `Foo<&'1 isize>`, for some specific lifetime `'1`
|
||||
= note: ...but it actually implements `Foo<&'static isize>`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-just-for-static.rs:30:5
|
||||
|
@ -5,7 +5,7 @@ LL | foo_hrtb_bar_not(&mut t);
|
||||
| ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
|
||||
|
|
||||
= note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`...
|
||||
= note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1`
|
||||
= note: ...but it actually implements `Bar<&'b isize>`
|
||||
|
||||
error: implementation of `Bar` is not general enough
|
||||
--> $DIR/hrtb-perfect-forwarding.rs:43:5
|
||||
@ -14,7 +14,7 @@ LL | foo_hrtb_bar_not(&mut t);
|
||||
| ^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
|
||||
|
|
||||
= note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`...
|
||||
= note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1`
|
||||
= note: ...but it actually implements `Bar<&'b isize>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -47,8 +47,8 @@ error: implementation of `FnOnce` is not general enough
|
||||
LL | baz(f);
|
||||
| ^^^ implementation of `FnOnce` is not general enough
|
||||
|
|
||||
= note: `fn(*mut &'2 u32)` must implement `FnOnce<(*mut &'1 u32,)>`, for any lifetime `'1`...
|
||||
= note: ...but it actually implements `FnOnce<(*mut &'2 u32,)>`, for some specific lifetime `'2`
|
||||
= note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
|
||||
= note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/closure-arg-type-mismatch.rs:10:5
|
||||
@ -75,8 +75,8 @@ error: implementation of `FnOnce` is not general enough
|
||||
LL | baz(f);
|
||||
| ^^^ implementation of `FnOnce` is not general enough
|
||||
|
|
||||
= note: `fn(*mut &'2 u32)` must implement `FnOnce<(*mut &'1 u32,)>`, for any lifetime `'1`...
|
||||
= note: ...but it actually implements `FnOnce<(*mut &'2 u32,)>`, for some specific lifetime `'2`
|
||||
= note: `fn(*mut &'a u32)` must implement `FnOnce<(*mut &'0 u32,)>`, for any lifetime `'0`...
|
||||
= note: ...but it actually implements `FnOnce<(*mut &'a u32,)>`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
@ -30,8 +30,8 @@ error: implementation of `FnOnce` is not general enough
|
||||
LL | type Bar = impl Baz<Self, Self>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
|
||||
|
|
||||
= note: closure with signature `fn(&'2 X) -> &'2 X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`...
|
||||
= note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2`
|
||||
= note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`...
|
||||
= note: ...but it actually implements `FnOnce<(&'static X,)>`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -4,8 +4,8 @@ error: implementation of `Bar` is not general enough
|
||||
LL | foo(&X);
|
||||
| ^^^ implementation of `Bar` is not general enough
|
||||
|
|
||||
= note: `Bar` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`...
|
||||
= note: ...but `Bar` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
|
||||
= note: `&'0 u32` must implement `Bar`, for any lifetime `'0`...
|
||||
= note: ...but `Bar` is actually implemented for the type `&'static u32`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user