Fix another false positive in lifetime elision lint

The false positive occurred when we have an anonymous input lifetime and a
named output lifetime. This is not elidable, because if we elided the output
lifetime, it would be inferred to be the same as the input.
This commit is contained in:
Florian Hartwig 2016-01-17 17:53:41 +01:00
parent 840d87022e
commit 7e85db645e
2 changed files with 4 additions and 1 deletions

View file

@ -144,7 +144,6 @@ fn could_use_elision(cx: &LateContext, func: &FnDecl, slf: Option<&ExplicitSelf>
match (&input_lts[0], &output_lts[0]) {
(&Named(n1), &Named(n2)) if n1 == n2 => true,
(&Named(_), &Unnamed) => true,
(&Unnamed, &Named(_)) => true,
_ => false, // already elided, different named lifetimes
// or something static going on
}