-
Notifications
You must be signed in to change notification settings - Fork 13.3k
diagnostics: do not give Option::as_ref suggestion for complex match #95127
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
diagnostics: do not give Option::as_ref suggestion for complex match #95127
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
I'm guessing it'd be difficult to find the correct span to suggest @bors r+ |
📌 Commit 306dcd6 has been approved by |
Basically, there might not be a correct span. I would have needed to go back to the THIR and walked the expr tree looking for it, with no guarantee of finding it, so no matter what happens we’ll need a fallback path eventually. match me() {
(a, Some(b)) => use(a, b)
}
fn me() -> (Foo, &Option<Bar>) { … }
fn use(a: Foo, b: &Bar) { … } |
☀️ Test successful - checks-actions |
Finished benchmarking commit (2d15732): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Fixes #82528