File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,8 @@ declare_clippy_lint! {
264264 /// The method signature is controlled by the trait and often `&self` is required for all types that implement the trait
265265 /// (see e.g. the `std::string::ToString` trait).
266266 ///
267+ /// Clippy allows `Pin<&Self>` and `Pin<&mut Self>` if `&self` and `&mut self` is required.
268+ ///
267269 /// Please find more info here:
268270 /// https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv
269271 ///
Original file line number Diff line number Diff line change @@ -87,3 +87,21 @@ mod issue3414 {
8787 }
8888 }
8989}
90+
91+ // don't trigger
92+ mod issue4546 {
93+ use std:: pin:: Pin ;
94+
95+ struct S ;
96+ impl S {
97+ pub fn as_mut ( self : Pin < & mut Self > ) { }
98+
99+ pub fn as_other_thingy ( self : Pin < & Self > ) { }
100+
101+ pub fn is_other_thingy ( self : Pin < & Self > ) { }
102+
103+ pub fn to_mut ( self : Pin < & mut Self > ) { }
104+
105+ pub fn to_other_thingy ( self : Pin < & Self > ) { }
106+ }
107+ }
You can’t perform that action at this time.
0 commit comments