5 #![allow(should_implement_trait)]
22 impl Default for Foo {
41 impl Default for Foo {
42 fn default() -> Self {
48 //todo the lint does not handle lifetimed struct
49 //the following module should trigger the lint on the third method only
51 struct Foo<'a>{foo_str: &'a str}
54 // Cannot use `Self` as return type, because the function is actually `fn foo<'b>(s: &'b str) -> Foo<'b>`
55 fn foo(s: &str) -> Foo {
58 // cannot replace with `Self`, because that's `Foo<'a>`
59 fn bar() -> Foo<'static> {
63 // `Self` is applicable here
64 fn clone(&self) -> Foo<'a> {
65 Foo {foo_str: self.foo_str}