Call pinned method from Trait on generic parameter #63966
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I've found a problem regarding Pin that I just can't solve and the current Nightly compiler gives a misleading suggestion.
This playground example serves well as a minimalist example. I can't manege to call
quack
on theAnimal
inside theTransporter
even with the restriction toAnimal: Quack
.And the Nightly compiler suggests:
Which clearly doesn't really solve anything.
If a take off the
Pin
from the Traits and it's impl and just use a&self
I can get the expectedQuack!
from inside the transporter.The compiler suggestion surely doesn't seams right to me, but what about the
Pin
? Am I missing something or is there a bug too?The text was updated successfully, but these errors were encountered: