-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
For the following code
pub trait Arbitrary: Sized + 'static {}
impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
The diagnostic looks like this:
error[E0477]: the type `std::borrow::Cow<'a, A>` does not fulfill the required lifetime
--> <anon>:3:20
|
3 | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
| ^^^^^^^^^
|
= note: type must outlive the static lifetime
The note here makes no sense, because the static lifetime is the longest lifetime of all and cannot really be outlived. We should reword the note so it doesn’t say “outlive”.
Bonus points for explaining where the lifetime requirement comes from, because it is not entirely clear what here introduces the requirement, when the trait and implementation definitions aren’t so close together.
gilescope, EvgeniiaVak, hartwork, McKinleyKeys, evbo and 2 more
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.