-
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
Refactor type & bounds parsing thoroughly #67148
Conversation
self.error_opt_out_lifetime(question); | ||
let bound = GenericBound::Outlives(self.expect_lifetime()); | ||
if has_parens { | ||
// FIXME(Centril): Consider not erroring here and accepting `('lt)` instead, |
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.
('lt)
is entirely useless and it's some PITA to parse it in the first trait object position like type A = ('lt) + OtherBounds
, so it isn't accepted anywhere.
I still feel like half of these changes (extracting small functions used once) make code readability worse, but you are the primary person working with this code now, so feel free to adjust it to your personal tastes basically. |
This comment has been minimized.
This comment has been minimized.
d345958
to
d977e5b
Compare
#67131 has merged & I've rebased this PR so it should be ready for review now. |
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.
LGTM
r=me after addressing nitpicks (including ignoring them)
Addressed the comments in the two commits above, @bors r=estebank |
📌 Commit 690b0b3 has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
Refactor type & bounds parsing thoroughly PR is based on rust-lang#67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`. Also fixes rust-lang#67146. r? @estebank
This comment has been minimized.
This comment has been minimized.
@bors r=estebank |
📌 Commit db4818f has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
Refactor type & bounds parsing thoroughly PR is based on rust-lang#67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`. Also fixes rust-lang#67146. r? @estebank
Refactor type & bounds parsing thoroughly PR is based on rust-lang#67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`. Also fixes rust-lang#67146. r? @estebank
Rollup of 6 pull requests Successful merges: - #67148 ( Refactor type & bounds parsing thoroughly) - #67410 (Reenable static linking of libstdc++ on windows-gnu) - #67439 (Cleanup `lower_pattern_unadjusted` & Improve slice pat typeck) - #67480 (Require issue = "none" over issue = "0" in unstable attributes) - #67500 (Tweak non_shorthand_field_patterns' suggestion) - #67504 (Warn against relying on ?Sized being last) Failed merges: r? @ghost
change an instance of span_bug() to struct_span_err() to avoid ICE After rust-lang#67148, the `span_bug()` in `parse_ty_tuple_or_parens()` is reachable because `parse_paren_comma_seq()` can return an `Ok()` even in cases where it encounters an error. This pull request prevents an ICE in such cases by replacing the `span_bug()` with `struct_span_error()`. Fixes rust-lang#68890.
PR is based on #67131 with first one from this PR being
extract parse_ty_tuple_or_parens
.Also fixes #67146.
r? @estebank