-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Trait object coercion to borrowed trait does not work with methods on &self
#9950
Comments
I think this will improve with DST, in that it would be possible to implement:
and then the required type of |
cc #6308 |
Triage: No change. Third example still fails to compile in the same way, this is symptomatic of larger issues around trait objects until DST lands. |
Triage: I am bad at DST, and so couldn't update the code sample. What's the state of this now? |
Triage: with no response in a year, and no real comments since 2013, and with tons of changes, I'm just going to close this one. |
Improve `EXIT` lint docs Super simple change, hopefully fast and fun to review. Have a great start to the weekend! changelog: none
This might not be a bug, but while writing extension traits for a trait object I discovered that calling a
&self
method of a trait implemented on a&Trait
does not work if it needs to borrow from a~Trait
or@Trait
first. This complicates things, because you need to explicit borrow to a&Trait
prior to making the call.As comparison, these three combinations work:
While this one fails to compile:
And this one is the workaround necessary to make it work:
The text was updated successfully, but these errors were encountered: