-
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
Rustup to https://github.com/rust-lang/rust/pull/66789 #4873
Conversation
maybe r? @oli-obk (this PR resulted from moving |
clippy_lints/src/redundant_clone.rs
Outdated
scope_local_data[terminator.source_info.scope].lint_root | ||
let scope = terminator.source_info.scope; | ||
let node = if let mir::ClearCrossCrate::Set(scope_local_data) = &mir.source_scopes[scope].local_data { | ||
scope_local_data.lint_root | ||
} else { | ||
unreachable!() |
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.
If you're going to panic, please use .as_ref().assert_crate_local()
like I did in my PR.
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.
That makes sense, thanks!
`assert_crate_local` does the same as the previous `if let` but with a more explicit error message if it's not a `ClearCrossCrate::Set`.
@bors r+ |
@eddyb: 🔑 Insufficient privileges: Not in reviewers |
@bors r=eddyb |
📌 Commit 474e9a1 has been approved by |
Rustup to rust-lang/rust#66789 changelog: none
☀️ Test successful - checks-travis, status-appveyor |
changelog: none