Auto merge of #7679 - lengyijun:issue4546, r=xFrednet
add #4546 test changelog: none fixed #4546 I notice #4546 was fixed some time, I just add the tests.
This commit is contained in:
commit
a4a8ec2d52
2 changed files with 20 additions and 0 deletions
|
@ -264,6 +264,8 @@ declare_clippy_lint! {
|
||||||
/// The method signature is controlled by the trait and often `&self` is required for all types that implement the trait
|
/// The method signature is controlled by the trait and often `&self` is required for all types that implement the trait
|
||||||
/// (see e.g. the `std::string::ToString` trait).
|
/// (see e.g. the `std::string::ToString` trait).
|
||||||
///
|
///
|
||||||
|
/// Clippy allows `Pin<&Self>` and `Pin<&mut Self>` if `&self` and `&mut self` is required.
|
||||||
|
///
|
||||||
/// Please find more info here:
|
/// Please find more info here:
|
||||||
/// https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv
|
/// https://rust-lang.github.io/api-guidelines/naming.html#ad-hoc-conversions-follow-as_-to_-into_-conventions-c-conv
|
||||||
///
|
///
|
||||||
|
|
|
@ -87,3 +87,21 @@ mod issue3414 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't trigger
|
||||||
|
mod issue4546 {
|
||||||
|
use std::pin::Pin;
|
||||||
|
|
||||||
|
struct S;
|
||||||
|
impl S {
|
||||||
|
pub fn as_mut(self: Pin<&mut Self>) {}
|
||||||
|
|
||||||
|
pub fn as_other_thingy(self: Pin<&Self>) {}
|
||||||
|
|
||||||
|
pub fn is_other_thingy(self: Pin<&Self>) {}
|
||||||
|
|
||||||
|
pub fn to_mut(self: Pin<&mut Self>) {}
|
||||||
|
|
||||||
|
pub fn to_other_thingy(self: Pin<&Self>) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue