-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Refactoring in support of generalized where clauses #19683
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
Refactoring in support of generalized where clauses #19683
Conversation
1f3c13b
to
f2b770a
Compare
D'oh! It seems that I left in a |
This looks pretty good to me @nikomatsakis. I'm assuming this is the branch you were talking to me about earlier on IRC. |
I just went to do a rebase of my changes on to master and it looks like it might be good to just wait and do it on top of these changes instead, there a few things important things that changed in the code, like the threading of the typing context lifetime through types like |
@jroesch yes, this is the branch. |
Regarding the TODO failure, I realize why all the tests pass -- the code as is basically omits instantiating the predicates vector for inlined code, but of course trans never even looks at the predicate vector. Still, it seems like asking for trouble to leave it as is -- though it's tempting since it will require touching metadata more deeply. >:( |
Sigh. I didn't run |
f2b770a
to
8d63a57
Compare
OK, the problems turned out to be acrichto's patch |
8d63a57
to
b9ae8db
Compare
Rebased. As of b9ae8db, |
(I still didn't fix the annoying metadata issue though.) |
b9ae8db
to
38a61f0
Compare
(OK, builds and passes make check locally now.) |
selections: &mut Vec<Selection<'tcx>>, | ||
errors: &mut Vec<FulfillmentError<'tcx>>, | ||
region_obligations: &mut NodeMap<Vec<RegionObligation<'tcx>>>) | ||
-> bool |
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.
THis might be clearer if it is called evaluate_predicate
or something and returns the opposite of what it currently does - i.e., false if the predicate could not be evaluated right now and must be retained.
r=me, modulo minor comments |
ca38302
to
2f1d5d6
Compare
in most cases, just the error message changed, but in some cases we are reporting new errors that OUGHT to have been reported before but we're overlooked (mostly involving the `'static` bound on `Send`).
used by trans, but it's easy to do.
2f1d5d6
to
124e1e1
Compare
Giving higher priority since this lays important groundwork for other patches for assoc types + unboxed closures |
…=nrc This patch does not itself enable generalized where clauses, but it lays the groundwork. Rather than storing a list of bounds per type parameter, the trait selection and other logic is now driven by a unified list of predicates. All predicate handling is now driven through a common interface. This also fixes a number of bugs where region predicates were being dropped on the floor. As a drive-by, this patch also fixes some bugs in the opt-out-copy feature flag. That said, this patch does not change the parser or AST in any way, so we still *generate* the list of predicates by walking a list of bounds (and we still *store* the bounds on the `TypeParameterDef` and so on). Those will get patched in a follow-up. The commits in this case are standalone; the first few are simple refactorings. r? @nick29581 cc @aturon
This patch does not itself enable generalized where clauses, but it lays the groundwork. Rather than storing a list of bounds per type parameter, the trait selection and other logic is now driven by a unified list of predicates. All predicate handling is now driven through a common interface. This also fixes a number of bugs where region predicates were being dropped on the floor. As a drive-by, this patch also fixes some bugs in the opt-out-copy feature flag.
That said, this patch does not change the parser or AST in any way, so we still generate the list of predicates by walking a list of bounds (and we still store the bounds on the
TypeParameterDef
and so on). Those will get patched in a follow-up.The commits in this case are standalone; the first few are simple refactorings.
r? @nick29581
cc @aturon