-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
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.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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 following code
pub trait Arbitrary: Sized + 'static {}
impl<'a, A> Arbitrary for ::std::borrow::Cow<'a, A> {}
The error is
error[E0277]: the trait bound `A: std::clone::Clone` is not satisfied
--> <anon>:3:13
|
3 | impl<'a, A> Arbitrary for ::std::borrow::Cow<'a, A> {}
| ^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `A`
|
= help: consider adding a `where A: std::clone::Clone` bound
= note: required because of the requirements on the impl of `std::borrow::ToOwned` for `A`
= note: required because it appears within the type `std::borrow::Cow<'a, A>`
= note: required by `Arbitrary`
Note the span is pointing at Arbitrary
, despite error really being about the generic bound A
. It should point at A
instead.
LukasKalbertodt
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.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.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.