-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
SpecExtend
for TrustedLen
is unsound
#89948
Comments
Is this actionable though? The question is whether it can be exploited by user code without using the feature gate itself. E.g. if there were an impl of |
Isn't this the same story with specialization being unsound with lifetimes? The current implementation for specialization seems to be ignoring the (from the RFC)
|
yes, that's the root issue here. |
It turns out that this is exactly analogous to the case documented in @aturon's blog: https://aturon.github.io/blog/2017/07/08/lifetime-dispatch/#cant-we-just-rule-out-bad-specializations |
Yeah, afaict it only shows that if you use As long as this isn't exploitable by stable code through some incorrect impl of Perhaps we could put a warning on the |
Also note that Copy has a similar hole that is exploitable by stable code and yet that has been tolerated (until specialization gets improved). |
I'm not sure this is a bug, as the comment on Calling In the original example, the lifetime selected for the |
results in:
The text was updated successfully, but these errors were encountered: