-
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
Check uses of Self
in impls in the compiler rather than during expansion
#23998
Conversation
Seems good. r+ if the supertrait thing is resolved (let me know if you think I'm off base...). |
@nikomatsakis ping for review of the second commit (assoc types in super traits). There are big enough changes there that I'd like you to take another look. (The error result type is fixed in the first commit). |
And fix a bug with type param visibility though the Self rib.
Closes #23909 r? @nikomatsakis (or anyone else, really)
@@ -2077,40 +2086,42 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { | |||
this.visit_generics(generics); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it possibly make sense to first do the this.with_current_self_type(self_type, |this| { ... })
and only do the this.visit_generics(generics);
within the { ... }
? It seems like it might fix #24944
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(alternatively, maybe we should first visit the generics.ty_params
outside of the with_current_self_type
, and then just move the visit of the generics.where_clause.predicates
into the inside of with_current_self_type
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(well, my attempt to quickly hack this in was met with failure: internal compiler error: self type has not been fully resolved
)
Closes #23909
r? @nikomatsakis (or anyone else, really)