Closed
Description
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 the Animal
inside the Transporter
even with the restriction to Animal: Quack
.
And the Nightly compiler suggests:
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `quack`, perhaps you need to restrict type parameter `Animal` with it:
|
17 | impl<Animal: Quack + Quack> Quack for Transporter<Animal> {
| ^^^^^^^^^^^^^^^
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 expected Quack!
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?