-
Couldn't load subscription status.
- Fork 13.9k
Parse Ty? as Option<Ty> and provide structured suggestion
#92746
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
Conversation
|
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
31447cc to
16ce938
Compare
Swift has specific syntax that desugars to `Option<T>` similar to our `?` operator, which means that people might try to use it in Rust. Parse it and gracefully recover.
16ce938 to
cfc0bd1
Compare
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.
Apologies for the delay in reviewing this. This looks great.
|
@bors r+ |
|
📌 Commit cfc0bd1 has been approved by |
|
Nice touch! C# has the same, where |
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#92487 (Fix unclosed boxes in pretty printing of TraitAlias) - rust-lang#92581 (ARMv6K Horizon - Enable default libraries) - rust-lang#92619 (Add diagnostic items for macros) - rust-lang#92635 (rustdoc: Yet more intra-doc links cleanup) - rust-lang#92646 (feat: rustc_pass_by_value lint attribute) - rust-lang#92706 (Clarify explicitly that BTree{Map,Set} are ordered.) - rust-lang#92710 (Include Projections when elaborating TypeOutlives) - rust-lang#92746 (Parse `Ty?` as `Option<Ty>` and provide structured suggestion) - rust-lang#92792 (rustdoc: fix intra-link for generic trait impls) - rust-lang#92814 (remove unused FIXME) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
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.
Follow up to rust-lang#92746. Address rust-lang#94510. (cherry picked from commit 004f2ed)
Swift has specific syntax that desugars to
Option<T>similar to our?operator, which means that people might try to use it in Rust. Parseit and gracefully recover.