2023-08-24 14:32:12 -05:00
|
|
|
#![deny(clippy::needless_lifetimes)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
trait Foo {}
|
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
|
|
|
|
struct Baz<'a> {
|
|
|
|
bar: &'a Bar,
|
|
|
|
}
|
|
|
|
|
2024-10-03 09:32:51 -05:00
|
|
|
impl Foo for Baz<'_> {}
|
2023-08-24 14:32:12 -05:00
|
|
|
|
|
|
|
impl Bar {
|
|
|
|
fn baz(&self) -> impl Foo + '_ {
|
|
|
|
//~^ ERROR: the following explicit lifetimes could be elided: 'a
|
|
|
|
Baz { bar: self }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|