Closed
Description
In #42669 , we are currently not improving the error message for the methods in traits. For this example,
trait Foo {
fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
// - consider changing the type of `x` to `&'a i32`
if x > y { x } else { y }
// ^ - lifetime `'a` required
}
}
note: ...changing the signature in the trait may require changing the corresponding impls of the trait
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
nikomatsakis commentedon Jun 16, 2017
Actually, I think we do cover this case in #42669 -- this would be a
NodeTraitItem
.nikomatsakis commentedon Jun 16, 2017
However, I think what I was concerned about here was that we might want to give more information (i.e., the
note
shown, although it seems a bit wordy). Not sure if that's worth it.steveklabnik commentedon Jun 28, 2020
Triage: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=af0e0b47620c290c33c3aacadc83e4db
I am not sure if this is good enough to close the bug or not.
nikomatsakis commentedon Jun 29, 2020
I think we can close it. Thanks.