Skip to content

Commit 73fd5e4

Browse files
committed
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.
1 parent e08cd3c commit 73fd5e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_errors::codes::*;
1414
use rustc_errors::{Applicability, Diag, MultiSpan, struct_span_code_err};
1515
use rustc_hir as hir;
1616
use rustc_hir::def::{DefKind, Res};
17-
use rustc_hir::intravisit::{Map, Visitor, walk_block, walk_expr};
17+
use rustc_hir::intravisit::{Visitor, walk_block, walk_expr};
1818
use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, LangItem, PatField};
1919
use rustc_middle::bug;
2020
use rustc_middle::hir::nested_filter::OnlyBodies;
@@ -1088,7 +1088,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10881088
] {
10891089
for (destination, sp) in elements {
10901090
if let Ok(hir_id) = destination.target_id
1091-
&& let hir::Node::Expr(expr) = tcx.hir().hir_node(hir_id)
1091+
&& let hir::Node::Expr(expr) = tcx.hir_node(hir_id)
10921092
&& !matches!(
10931093
sp.desugaring_kind(),
10941094
Some(DesugaringKind::ForLoop | DesugaringKind::WhileLoop)

0 commit comments

Comments
 (0)