2 #![warn(clippy::return_self_not_must_use)]
8 fn what(&self) -> Self;
9 // There should be no warning here! (returns a reference)
10 fn what2(&self) -> &Self;
14 // There should be no warning here! (note taking a self argument)
15 pub fn not_new() -> Self {
18 pub fn foo(&self) -> Self {
21 pub fn bar(self) -> Self {
24 // There should be no warning here! (private method)
25 fn foo2(&self) -> Self {
28 // There should be no warning here! (returns a reference)
29 pub fn foo3(&self) -> &Self {
32 // There should be no warning here! (already a `must_use` attribute)
34 pub fn foo4(&self) -> Self {
39 impl Whatever for Bar {
40 // There should be no warning here! (comes from the trait)
41 fn what(&self) -> Self {
44 // There should be no warning here! (comes from the trait)
45 fn what2(&self) -> &Self {
54 // There should be no warning here! (`Foo` already implements `#[must_use]`)
55 fn foo(&self) -> Self {