mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 06:14:55 +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
@ -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 New Issue
Block a user