-
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
The "type_alias_impl_trait" feature has problems handling lifetime parameters. #69137
Comments
When I wrote #69008, I assumed that the three types of generic substs (types, lifetimes, and consts) were all handled in the same way for opaque types. However, this is not the case: the handling of lifetimes is significantly more complicated than that of types or consts. I still think that using the 'parent' opaque type as the 'parent' generics is the best approach. However, it's going to require several changes to how we process lifetimes. In particular, we'll need to ensure that simply using a lifetime (e.g. |
Errors on master give correct suggestion
Change This just needs to be added as a test. |
Seems like this works (with the additional |
Actually it used to work without the |
For |
I was starting with this function (which does compile on nightly):
and wanted to give a name to its return type.
The straightforward approach seems to be (please correct me if the "right" way to do this is different):
But the compiler is currently unhappy with the lifetimes. I'm getting the following.
It works without the lifetimes (i.e. after removing parametrization over 'a and replacing all occurrences of 'a with 'static), like this:
Meta
Current behavior only since #67844 was fixed (after
nightly-2020-02-14
). Before that, this code triggered an ICE.The text was updated successfully, but these errors were encountered: