-
Notifications
You must be signed in to change notification settings - Fork 1.7k
needless_lifetimes ignores trait bounds #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'd like to add that we still have false positives even after #599 – The followig (from rust-bio) is still linted:
|
Users of Serde are going to start hitting this really badly in the next release as we are adding a lifetime to the Deserializer trait. fn f<'de, D: Deserializer<'de>>(deserializer: D) -> Result<F, D::Error> { /* ... */ } It would be great to fix this before Serde 1.0. |
@dtolnay I believe a simple case like this is already not linted against? |
@mcarton for whatever reason that is not the same. In particular: trait WithLifetime<'a> {}
fn trait_bound<'a, T: WithLifetime<'a>>() { unimplemented!() }
|
fn foo<'a, T: Foo<'a>>(&'a u8, T)
will hit the lint. It shouldn't, whenever we have lifetimes in trait bounds we should bail.The text was updated successfully, but these errors were encountered: