-
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 lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-trait-systemArea: Trait systemArea: Trait systemD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.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
trait A<'a> {
fn a<'b>(self) -> Box<A<'b>>;
}
struct C;
impl<'a> A<'a> for C {
fn a<'b>(self) -> Box<A<'a>>{}
}
it would be much more useful if we spanned the offending lifetime rather than the whole method: i.e. like this
error: method `a` has an incompatible type for trait:
expected bound lifetime parameter 'b,
found concrete lifetime [--explain E0053]
--> <anon>:8:5
8 |> fn a<'b>(self) -> Box<A<'a>>{}
|> ^^
instead of
error: method `a` has an incompatible type for trait:
expected bound lifetime parameter 'b,
found concrete lifetime [--explain E0053]
--> <anon>:8:5
8 |> fn a<'b>(self) -> Box<A<'a>>{}
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsA-trait-systemArea: Trait systemArea: Trait systemD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.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.