-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[unnecessary_literal_unwrap
]: Fix ICE on None.unwrap_or_default()
#11106
Conversation
r? @dswij (rustbot has picked a reviewer for you, use r? to override) |
Nice, I was about to look into this one as well! ^^ Can you handle these also and add tests for them? |
0d94bbf
to
a80778c
Compare
I updated this to add specific error messages for |
☔ The latest upstream changes (presumably #11098) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #11138) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Thanks for this! Sorry for the slow review.
@bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
…k-Simulacrum [beta] Clippy backports for ICE fixes This backports PRs to beta, that fix ICEs, some lint grouping and FP fixes. Namely: - rust-lang/rust-clippy#11191 - rust-lang/rust-clippy#11172 - rust-lang/rust-clippy#11130 - rust-lang/rust-clippy#11106 - rust-lang/rust-clippy#11104 - rust-lang/rust-clippy#11077 - rust-lang/rust-clippy#11070 (This PR is not synced to the Rust repo yet, but I will open a separate PR to get it into `master`, before beta is branched: rust-lang#114938) - rust-lang/rust-clippy#11069 Kind of a big backport, but most of it is tests. r? `@Mark-Simulacrum` cc `@Manishearth`
Fixes #11099
Fixes #11064
I'm running into #11099 (cc @y21) on my Rust codebase. Clippy ICEs on this code when evaluating the
unnecessary_literal_unwrap
lint:This fixes that ICE and adds an message specifically for that case:
This PR also fixes the same ICE with
None.unwrap_or_else
(by giving the generic error message for the lint in that case).changelog: Fix ICE in
unnecessary_literal_unwrap
onNone.unwrap_or_default()