-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Implement parsing and conversion of generalized where clauses #20002
Implement parsing and conversion of generalized where clauses #20002
Conversation
I'll take another read through, but what is here looks pretty good to me. There are several follow-on points though. These could be addressed in separate PRs. I will create issues for these points and attach them to #17657.
but today the parser only accepts
would be equivalent to:
Points 3 and 4 probably require an RFC. |
I've created issues for each of those points in #17657 |
@@ -1459,6 +1459,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> { | |||
self.check_ty_param_bound(bound_pred.span, bound) | |||
} | |||
} | |||
// ? for Niko: Anything to do here? |
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.
No, this is fine, I don't see how privacy impacts anything here.
OK, I went through the commits and offered commits. It's also probably a good idea to cleanup the history a bit, though I'm not a stickler about this (but the intermediate commits don't seem... especially useful here; also, don't worry about preserving authorship on the commit that came from me). I'd like to see some more tests. Here are two I wrote to test the code, they seem to work (which is awesome): https://github.com/nikomatsakis/rust/tree/jroesch-generalized-where-clause-parser/ It'd be great to see also tests that add builtin bounds locally, since they are treated rather differently. In particular |
OK, ping me on IRC if there are any questions. |
8812328
to
2fae8e5
Compare
I just rebased, and squashed them into a single commit. Hopefully I have addressed all the comments, and will begin chasing down some of the follow up issues. |
cec2295
to
5e86648
Compare
As discussed on IRC, r+ with one additional test that shows a where clause with a generic trait, so that substitution is required. |
b1e1e77
to
f999f0d
Compare
Tests should be in an acceptable state now. Should be good to go 👍. |
f999f0d
to
05b58ae
Compare
Giving p=1 because this enables work on stdlib |
cee12ab
to
f4ed79d
Compare
f4ed79d
to
2436f79
Compare
Implement support in the parser for generalized where clauses, as well as the conversion of ast::WherePredicates to ty::Predicate in `collect.rs`.
bb6a77b
to
bdd61f8
Compare
bdd61f8
to
d87b308
Compare
…ser, r=nikomatsakis This is the same branch as #20002 but with the pretty-printing test fixed.
Going to tentatively open a PR before I move on to other things tonight. I think everything should be good minus a failing test case for region bounds (gonna push that now, i.e 'a : 'b). r? @nikomatsakis
Fixes #20023.