Skip to content

Commit 7ff6790

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 5bc6231 commit 7ff6790

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+2-2
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;
@@ -1082,7 +1082,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10821082
] {
10831083
for (destination, sp) in elements {
10841084
if let Ok(hir_id) = destination.target_id
1085-
&& let hir::Node::Expr(expr) = tcx.hir().hir_node(hir_id)
1085+
&& let hir::Node::Expr(expr) = tcx.hir_node(hir_id)
10861086
&& !matches!(
10871087
sp.desugaring_kind(),
10881088
Some(DesugaringKind::ForLoop | DesugaringKind::WhileLoop)

0 commit comments

Comments
 (0)