Refer to synthetically named lifetimes as "some specific lifetime" rather than "the specific lifetime"
This commit is contained in:
parent
e077501b54
commit
c97d135452
@ -416,14 +416,14 @@ impl NiceRegionError<'me, 'gcx, 'tcx> {
|
||||
if any_self_ty_has_vid {
|
||||
err.note(&format!(
|
||||
"but `{}` is actually implemented for the type `{}`, \
|
||||
for the specific lifetime `'{}`",
|
||||
for some specific lifetime `'{}`",
|
||||
actual_trait_ref,
|
||||
actual_trait_ref.self_ty(),
|
||||
n
|
||||
));
|
||||
} else {
|
||||
err.note(&format!(
|
||||
"but `{}` actually implements `{}`, for some lifetime `'{}`",
|
||||
"but `{}` actually implements `{}`, for some specific lifetime `'{}`",
|
||||
actual_trait_ref.self_ty(),
|
||||
actual_trait_ref,
|
||||
n
|
||||
|
@ -42,7 +42,7 @@ LL | tuple_one::<Tuple>();
|
||||
|
|
||||
= note: Due to a where-clause on `tuple_one`,
|
||||
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
|
||||
= note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some lifetime `'2`
|
||||
= note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
|
||||
|
||||
error: implementation of `TheTrait` is not general enough
|
||||
--> $DIR/associated-types-eq-hr.rs:96:5
|
||||
@ -52,7 +52,7 @@ LL | tuple_two::<Tuple>();
|
||||
|
|
||||
= note: Due to a where-clause on `tuple_two`,
|
||||
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
|
||||
= note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some lifetime `'2`
|
||||
= note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
|
||||
|
||||
error: implementation of `TheTrait` is not general enough
|
||||
--> $DIR/associated-types-eq-hr.rs:105:5
|
||||
@ -62,7 +62,7 @@ LL | tuple_four::<Tuple>();
|
||||
|
|
||||
= note: Due to a where-clause on `tuple_four`,
|
||||
= note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
|
||||
= note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some lifetime `'2`
|
||||
= note: but `Tuple` actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | foo(());
|
||||
|
|
||||
= note: Due to a where-clause on `foo`,
|
||||
= note: `Mirror` would have to be implemented for the type `&'0 ()`, for any lifetime `'0`
|
||||
= note: but `Mirror` is actually implemented for the type `&'1 ()`, for the specific lifetime `'1`
|
||||
= note: but `Mirror` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | assert_foo(gen);
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= 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 the specific lifetime `'1`
|
||||
= note: but `Foo` is actually implemented for the type `&'1 OnlyFooIfStaticRef`, for some specific lifetime `'1`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/auto-trait-regions.rs:48:5
|
||||
@ -14,7 +14,7 @@ LL | assert_foo(gen);
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`
|
||||
= note: but `Foo` is actually implemented for the type `A<'_, '2>`, for the specific lifetime `'2`
|
||||
= note: but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | assert_deserialize_owned::<&'static str>(); //~ ERROR
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `&'static str` must implement `Deserialize<'0>`, for any lifetime `'0`
|
||||
= note: but `&str` actually implements `Deserialize<'1>`, for some lifetime `'1`
|
||||
= note: but `&str` actually implements `Deserialize<'1>`, for some specific lifetime `'1`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | fn b() { want_foo2::<SomeStruct>(); } //~ ERROR
|
||||
|
|
||||
= note: Due to a where-clause on `want_foo2`,
|
||||
= note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`
|
||||
= note: but `SomeStruct` actually implements `Foo<(&'2 isize, &'2 isize)>`, for some lifetime `'2`
|
||||
= note: but `SomeStruct` actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | foo::<()>(); //~ ERROR not general enough
|
||||
|
|
||||
= note: Due to a where-clause on `foo`,
|
||||
= note: `()` must implement `Trait<for<'b> fn(std::cell::Cell<&'b u32>)>`
|
||||
= note: but `()` actually implements `Trait<fn(std::cell::Cell<&'0 u32>)>`, for some lifetime `'0`
|
||||
= note: but `()` actually implements `Trait<fn(std::cell::Cell<&'0 u32>)>`, for some specific lifetime `'0`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | want_hrtb::<StaticInt>() //~ ERROR
|
||||
|
|
||||
= note: Due to a where-clause on `want_hrtb`,
|
||||
= note: `StaticInt` must implement `Foo<&'0 isize>`, for any lifetime `'0`
|
||||
= note: but `StaticInt` actually implements `Foo<&'1 isize>`, for some lifetime `'1`
|
||||
= note: but `StaticInt` actually implements `Foo<&'1 isize>`, for some specific lifetime `'1`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/hrtb-just-for-static.rs:30:5
|
||||
@ -16,7 +16,7 @@ LL | want_hrtb::<&'a u32>() //~ ERROR
|
||||
|
|
||||
= note: Due to a where-clause on `want_hrtb`,
|
||||
= note: `Foo<&'0 isize>` would have to be implemented for the type `&'a u32`, for any lifetime `'0`
|
||||
= note: but `Foo<&'1 isize>` is actually implemented for the type `&'1 u32`, for the specific lifetime `'1`
|
||||
= note: but `Foo<&'1 isize>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | foo_hrtb_bar_not(&mut t); //~ ERROR not general enough
|
||||
|
|
||||
= note: Due to a where-clause on `foo_hrtb_bar_not`,
|
||||
= note: `&mut T` must implement `Foo<&'0 isize>`, for any lifetime `'0`
|
||||
= note: but `&mut T` actually implements `Foo<&'1 isize>`, for some lifetime `'1`
|
||||
= note: but `&mut T` actually implements `Foo<&'1 isize>`, for some specific lifetime `'1`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | <u32 as RefFoo<u32>>::ref_foo(a)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Foo<'static, u32>` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`
|
||||
= note: but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for the specific lifetime `'1`
|
||||
= note: but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/issue-54302-cases.rs:69:5
|
||||
@ -14,7 +14,7 @@ LL | <i32 as RefFoo<i32>>::ref_foo(a)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Foo<'static, i32>` would have to be implemented for the type `&'0 i32`, for any lifetime `'0`
|
||||
= note: but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for the specific lifetime `'1`
|
||||
= note: but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/issue-54302-cases.rs:75:5
|
||||
@ -23,7 +23,7 @@ LL | <u64 as RefFoo<u64>>::ref_foo(a)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Foo<'static, u64>` would have to be implemented for the type `&'0 u64`, for any lifetime `'0`
|
||||
= note: but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for the specific lifetime `'1`
|
||||
= note: but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1`
|
||||
|
||||
error: implementation of `Foo` is not general enough
|
||||
--> $DIR/issue-54302-cases.rs:81:5
|
||||
@ -32,7 +32,7 @@ LL | <i64 as RefFoo<i64>>::ref_foo(a)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `Foo<'static, i64>` would have to be implemented for the type `&'0 i64`, for any lifetime `'0`
|
||||
= note: but `Foo<'_, i64>` is actually implemented for the type `&'1 i64`, for the specific lifetime `'1`
|
||||
= note: but `Foo<'_, i64>` is actually implemented for the type `&'1 i64`, for some specific lifetime `'1`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | assert_deserialize_owned::<&'static str>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `&'static str` must implement `Deserialize<'0>`, for any lifetime `'0`
|
||||
= note: but `&str` actually implements `Deserialize<'1>`, for some lifetime `'1`
|
||||
= note: but `&str` actually implements `Deserialize<'1>`, for some specific lifetime `'1`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -5,7 +5,7 @@ LL | let x = <fn (&())>::make_g(); //~ ERROR not general enough
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `X` would have to be implemented for the type `for<'r> fn(&'r ())`
|
||||
= note: but `X` is actually implemented for the type `fn(&'0 ())`, for the specific lifetime `'0`
|
||||
= note: but `X` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | foo(&X); //~ ERROR implementation of `Bar` is not general enough
|
||||
|
|
||||
= note: Due to a where-clause on `foo`,
|
||||
= 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 the specific lifetime `'1`
|
||||
= note: but `Bar` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user