-
Notifications
You must be signed in to change notification settings - Fork 13.3k
TryFrom
trait bound on trait definition complains about missing From
impl
#80484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a duplicate of #20671 It complains about |
I see, but |
It sees your local ps: I think the way rustc works is that |
Current complete error:
|
I tried this code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a9fcf72c4bbeb63baf3dffb724d37852
I expected it to compile successfully.
Instead, it fails to compile with the error:
I do not expect that a
From
implementation is needed when implementingTryFrom
.If I remove the trait bound from the trait
Container
, and place it on the functionfoo
instead, it works as expected: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a4bdca2f01cd2a33f85d18e5ebdb5181Also, if the trait bound is changed to not include lifetimes or references, this works as well: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a2e8dbad7838e71b6c0b8a42fca57509
The issue happens on both Beta and Nightly.
The text was updated successfully, but these errors were encountered: