Open
Description
openedon May 13, 2016
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>>{}
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: Lifetimes / regionsArea: Trait systemDiagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Relevant to the compiler team, which will review and decide on the PR/issue.