diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-03 16:08:48 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-17 09:53:27 +1100 |
| commit | 7ff67901acd7dd0669a2f41a618d5e539b6d3663 (patch) | |
| tree | 2b74cc4612b849aee7da049efd9c1acc564b99ec | |
| parent | 5bc62314547c7639484481f62f218156697cfef0 (diff) | |
| download | rust-7ff67901acd7dd0669a2f41a618d5e539b6d3663.tar.gz rust-7ff67901acd7dd0669a2f41a618d5e539b6d3663.zip | |
Avoid unnecessary use of the `Map` trait.
The `Map` trait is there for cases where `tcx` isn't available. This isn't one of those cases, so it's simpler to just call through `tcx` directly.
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index 6269728e67f..8fa409f4e38 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -14,7 +14,7 @@ use rustc_errors::codes::*; use rustc_errors::{Applicability, Diag, MultiSpan, struct_span_code_err}; use rustc_hir as hir; use rustc_hir::def::{DefKind, Res}; -use rustc_hir::intravisit::{Map, Visitor, walk_block, walk_expr}; +use rustc_hir::intravisit::{Visitor, walk_block, walk_expr}; use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, LangItem, PatField}; use rustc_middle::bug; use rustc_middle::hir::nested_filter::OnlyBodies; @@ -1082,7 +1082,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { ] { for (destination, sp) in elements { if let Ok(hir_id) = destination.target_id - && let hir::Node::Expr(expr) = tcx.hir().hir_node(hir_id) + && let hir::Node::Expr(expr) = tcx.hir_node(hir_id) && !matches!( sp.desugaring_kind(), Some(DesugaringKind::ForLoop | DesugaringKind::WhileLoop) |
