Adjust codegen logic for range and guarded arms#13940
Merged
Merged
Conversation
Contributor
|
\o/ |
It has been found that rust-lang#13034 was flawed and caused regression rust-lang#13867. This patch reveres the changes made by it except the companion tests.
By carefully distinguishing falling back to the default arm from moving on to the next pattern, this patch adjusts the codegen logic for range and guarded arms of pattern matching expression. It is a more appropriate way of fixing rust-lang#12582 and rust-lang#13027 without causing regressions such as rust-lang#13867. Closes rust-lang#13867
Contributor
Author
|
r? |
bors
added a commit
that referenced
this pull request
May 6, 2014
By carefully distinguishing falling back to the default arm from moving on to the next pattern, this patch adjusts the codegen logic for range and guarded arms of pattern matching expression. It is a more appropriate way of fixing #12582 and #13027 without causing regressions such as #13867. Closes #13867
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 13, 2023
Fix panicking Option unwraping in match arm analysis Hi, first PR here! I've noticed my IDE sometimes briefly becoming pretty slow to respond while writing Rust. When checking the logs I found reams of this same error repeating itself. ``` thread 'Worker' panicked at 'called `Option::unwrap()` on a `None` value' crates/ide-assists/src/handlers/convert_match_to_let_else.rs:90:46 ``` RA seemed to have been panicking on virtually every keystroke I made whenever I was part way through writing/refactoring a match statement of relevance to this assist. The fix in this PR should be self-explanatory.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jan 9, 2025
…mments (rust-lang#13940) Fixes rust-lang/rust-clippy#8528. Similar to rust-lang#13911, if there are code comments, we don't want to remove them automatically. changelog: Don't emit machine applicable `map_flatten` lint if there are code comments r? @xFrednet
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
By carefully distinguishing falling back to the default arm from moving
on to the next pattern, this patch adjusts the codegen logic for range
and guarded arms of pattern matching expression. It is a more
appropriate way of fixing #12582 and #13027 without causing regressions
such as #13867.
Closes #13867