Skip to content
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

Adjust codegen logic for range and guarded arms #13940

Merged
merged 2 commits into from
May 6, 2014

Conversation

edwardw
Copy link
Contributor

@edwardw edwardw commented May 5, 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

@lilyball
Copy link
Contributor

lilyball commented May 5, 2014

\o/

edwardw added 2 commits May 5, 2014 20:16
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
@edwardw
Copy link
Contributor Author

edwardw commented May 5, 2014

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 bors closed this May 6, 2014
@bors bors merged commit 90449ab into rust-lang:master May 6, 2014
@edwardw edwardw deleted the refutable-match branch May 6, 2014 05:16
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong matching with enums and overlapping ranges
4 participants