Ask questionsPin<&mut self> triggers "wrong_self_convention"

<!-- Hi there! Whether you've come to make a suggestion for a new lint, an improvement to an existing lint or to report a bug or a false positive in Clippy, you've come to the right place.

For bug reports and false positives, please include the output of cargo clippy -V in the report.

Thank you for using Clippy!

Write your comment below this line: -->

Clippy doesn't like it when we use Pin over the Self type:


pub fn as_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Output>;


error: methods called `as_*` usually take self by reference or self by mutable reference; consider choosing a less ambiguous name

  --> src/


36 |     pub fn as_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Output> {

   |                   ^^^^


   = note: `-D clippy::wrong-self-convention` implied by `-D clippy`

   = help: for further information visit

This seems like it might be related to and Though it's also possible this may be working exactly as intended, but I'm not sure.


Answer questions mikerite

The lint should probably be changed.

Example from the standard library using similar naming/signature:

This is related to issue #4293.

Github User Rank List