-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
associated type does not live long enough #23442
Comments
The strategy I had in mind was to require that for every associated type
This allows us later to deduce that if |
Ah, well, I can see why the original fix didn't work. Nothing in the current system allows it to deduce that |
This appears to compile with |
There is a FIXME related to this issue, |
A long time ago, FIXMEs were left to implement AsRef and AsRef for all types which implemented Deref and DerefMut. This wasn't done at the time because of rust-lang#23442. Unfortunately, it's not possible to add these implementations backwards-compabily, since they can cause conflicting implementation overlaps.
This program fails to compile:
This was supposed to be fixed by #22436, but apparently that fix is not working. I've been wanting to revisit the strategy there anyway, because it leads to infinite recursion in some cases and I'm not happy about it.
The error I see is:
The text was updated successfully, but these errors were encountered: