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:
parent
840d87022e
commit
7e85db645e
2 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue