Change:
<del> error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method` </del> <ins> error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method`, `method2`, `method3`, `method4`, `method5` </ins> --> $DIR/m2.rs:9:1 | LL | impl m1::X for X { <del> | ^^^^^^^^^^^^^^^^ missing `CONSTANT`, `Type`, `method` in implementation </del> <ins> | ^^^^^^^^^^^^^^^^ missing `CONSTANT`, `Type`, `method`, `method2`, `method3`, `method4`, `method5` in implementation </ins> | = help: implement the missing item: `const CONSTANT: u32 = 42;` = help: implement the missing item: `type Type = Type;` = help: implement the missing item: `fn method(&self, _: std::string::String) -> <Self as m1::X>::Type { todo!() }` <ins> = help: implement the missing item: `fn method2(self: std::boxed::Box<Self>, _: std::string::String) -> <Self as m1::X>::Type { todo!() }` = help: implement the missing item: `fn method3(_: &Self, _: std::string::String) -> <Self as m1::X>::Type { todo!() }` = help: implement the missing item: `fn method4(&self, _: &Self) -> <Self as m1::X>::Type { todo!() }` = help: implement the missing item: `fn method5(self: &std::boxed::Box<Self>) -> <Self as m1::X>::Type { todo!() }` </ins> error: aborting due to previous error

Discussion:
In the error message below, the first argument of is not named . () Errors: modify labels: T-compiler, A-diagnostics, C-enhancement, D-papercut, F-arbitraryselftypes. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --This issue has been assigned to via . <!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
I managed to fix this issue by just manually checking if the argument is of type , and if it is it returns where ty is the type of the argument (in this case std::pin::Pin<&mut Self). I'm not sure if there is a better way, I'm going to make a PR tomorrow, if anyone has a better solution, please tell me.
I’m not just interested in a fix for this particular case. Types that allow dispatch can be arbitrarily nested AFAIK and also I didn’t tag for no reason - these can be extended. Furthermore the correct way to fix this is probably not to just add code but rather to change ~existing logic that must be somewhere already, for example some code currently does make , and parameters print correctly and differently from non-self parameters that have type or~...... let me double-check that.... Oh, wow, I’ll expand this bug-report. Create a binary crate named “my-crate” with: Error message is:
Makes sense as if I recall correctly (can't link files rn as I am on my phone) the code literally just checks if the type is (&/&mut)Self and if it is it prints (&/&mut)self otherwise it prints _: Type. A potential fix could be printing (&/&mut)self only if it's the first argument of the function
Won’t be enough. The first parameter of a trait fn could be of type without being named . It actually needs to check if it’s a parameter. That information should be retrievable somewhere in the compiler. Furthermore then the rest is easy: First step: check if it’s a parameter. If not: use . If it however is one, then check for the type being or or , printing , or respectively; otherwise print .

Another issue related to this is when you have a function that has a signature of The compiler suggests to implement the function using , but that doesn't work I should have fixed it, as soon as all of the tests pass I will make a PR