-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Do not recover from Ty?
in macro parsing
#94593
Conversation
Follow up to rust-lang#92746. Address rust-lang#94510.
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
r? @davidtwco @bors r+ rollup |
📌 Commit 004f2ed has been approved by |
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
@@ -305,7 +317,7 @@ impl<'a> Parser<'a> { | |||
// Try to recover from use of `+` with incorrect priority. | |||
self.maybe_report_ambiguous_plus(allow_plus, impl_dyn_multi, &ty); | |||
self.maybe_recover_from_bad_type_plus(allow_plus, &ty)?; | |||
let ty = self.maybe_recover_from_question_mark(ty, is_as_cast); | |||
let ty = self.maybe_recover_from_question_mark(ty, recover_question_mark); |
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.
If further problems are encountered in the future, then the appropriate change will be to change this to return the specific Err()
instead of allowing successful subsequent parses. That'd be a shame, but it'd be a straightforward change (and don't envision it being a problem anywhere else other than exprs and macros, which are now both handled).
[beta] backports + bootstrap bump Add pending backports: * Revert accidental stabilization rust-lang#94805 * Do not recover from Ty? in macro parsing rust-lang#94593 * Fix cmake build. rust-lang#95050 And updates the bootstrap compiler to 1.59.0.
Follow up to #92746. Address #94510.