-
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
Permit higher-ranked qualifiers to enclose the self type #20022
Comments
@nikomatsakis you mentioned filling an RFC for this behavior + impossible impls, should we follow up on that or hold off until we close the rest of the issues. It seems like a relatively succinct set of changes. |
I am placing this on the beta milestone due to the importance for working with bigints and the like. cc @aturon |
There are some minor syntactic issues to work out. My preference would be to accept only the simplest possible form:
We would not accept any of the following:
|
Fixing this is exposing quite a lot of sadness, mostly around the representation of trait refs. I am currently trying to resist the temptation to fix it properly because that seems like a lot of work and touches a lot of complex parts of the compiler. So, currently part of a where clause such as This is probably OK for most of the compiler - it is fine to extend the scope of the quantifier. But lifetime resolution needs the precise scope. There doesn't seem to be a nice way to coelesce the lifetimes bound in the two places ( |
On Wed, Feb 04, 2015 at 06:43:56PM -0800, Nick Cameron wrote:
This is by design, yes, in anticipation of wanting to support precisely this feature.
Perhaps we should chat about this live, probably easier. Lifetime |
Oh, I see your PR now, guess it's a moot point. |
There is a need to permit
for
qualifiers that appear in more places. In particular, I'd like to be able to write something like this:but today the parser only accepts
for
after the:
. the rest of the code already considers'a
and'b
to be in scope for the self-type of the trait, so it's just the parser that has to be changed. I imagine that thefor
, in that case, would distribute over all the attached where clauses, so:would be equivalent to:
Nested
for
qualifiers would be illegal, I think:The text was updated successfully, but these errors were encountered: