-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Self is not recognised as implementing inherited traits in default method implementations #7661
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Yeah, the interaction of default methods and inheritance basically doesn't work at all. Part of #2794. |
@msullivan Thanks, that fixes the first example, but it doesn't fix the second example (the |
Opened #8171 about the second example ( |
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Sep 28, 2021
Fix various redundant_closure bugs changelog: Fix various false negatives and false positives for [`redundant_closure`] Closes rust-lang#3071 Closes rust-lang#4002 This lint is full of weird nuances and this is basically a re-write to tighten up the logic.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Sample code:
I expect this to succeed. It does not:
Note that the inheritance works correctly at the
impl
level:Second example, using
Send
, a kind, rather than a trait of my own devising:This similarly does not compile, though it should:
This, in fact, is how I came across the problem, because I'm wanting to refer to
self
inside aspawn
block, and that will only work if it'sSend
, and so there I sadly cannot provide a default method implementation of the trait at present.The text was updated successfully, but these errors were encountered: