-
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
Parse Ty?
as Option<Ty>
and provide structured suggestion
#92746
Merged
+125
−37
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jan 10, 2022
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jan 10, 2022
camelid
added
the
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
label
Jan 10, 2022
estebank
force-pushed
the
question-mark-in-type
branch
from
January 12, 2022 23:49
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.
estebank
force-pushed
the
question-mark-in-type
branch
from
January 14, 2022 00:07
16ce938
to
cfc0bd1
Compare
davidtwco
approved these changes
Jan 16, 2022
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 |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 16, 2022
Nice touch! C# has the same, where |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 16, 2022
…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
estebank
added a commit
to estebank/rust
that referenced
this pull request
Mar 4, 2022
Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
Do not recover from `Ty?` in macro parsing Follow up to rust-lang#92746. Address rust-lang#94510.
cuviper
pushed a commit
to cuviper/rust
that referenced
this pull request
Mar 18, 2022
Follow up to rust-lang#92746. Address rust-lang#94510. (cherry picked from commit 004f2ed)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.