mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
Merge pull request #555 from fhartwig/elision-fix
Fix another false positive in lifetime elision lint
This commit is contained in:
commit
e2b1a050b1
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
|
||||
}
|
||||
|
|
|
@ -119,5 +119,9 @@ fn alias_with_lt3<'a>(_foo: &FooAlias<'a> ) -> &'a str { unimplemented!() }
|
|||
// no warning, two input lifetimes
|
||||
fn alias_with_lt4<'a, 'b>(_foo: &'a FooAlias<'b> ) -> &'a str { unimplemented!() }
|
||||
|
||||
fn named_input_elided_output<'a>(_arg: &'a str) -> &str { unimplemented!() } //~ERROR explicit lifetimes given
|
||||
|
||||
fn elided_input_named_output<'a>(_arg: &str) -> &'a str { unimplemented!() }
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue