From 3ee4e5f7040e2c7bca4dd39a6c5670c1a343eeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Fri, 15 Jul 2022 11:07:20 -0700 Subject: [PATCH] Fix rebase --- .../rustc_borrowck/src/diagnostics/conflict_errors.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index c4eed784b88a..bc64cb81179d 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -7,7 +7,7 @@ }; use rustc_hir as hir; use rustc_hir::def_id::DefId; -use rustc_hir::intravisit::{walk_expr, Visitor}; +use rustc_hir::intravisit::{walk_block, walk_expr, Visitor}; use rustc_hir::{AsyncGeneratorKind, GeneratorKind}; use rustc_infer::infer::TyCtxtInferExt; use rustc_infer::traits::ObligationCause; @@ -1504,8 +1504,6 @@ fn report_temporary_value_does_not_live_long_enough( let mut suggested = false; let msg = "consider using a `let` binding to create a longer lived value"; - use rustc_hir::intravisit::Visitor; - /// We check that there's a single level of block nesting to ensure always correct /// suggestions. If we don't, then we only provide a free-form message to avoid /// misleading users in cases like `src/test/ui/nll/borrowed-temporary-error.rs`. @@ -1520,14 +1518,14 @@ struct NestedStatementVisitor { impl<'tcx> Visitor<'tcx> for NestedStatementVisitor { fn visit_block(&mut self, block: &hir::Block<'tcx>) { self.current += 1; - rustc_hir::intravisit::walk_block(self, block); + walk_block(self, block); self.current -= 1; } fn visit_expr(&mut self, expr: &hir::Expr<'tcx>) { if self.span == expr.span { self.found = self.current; } - rustc_hir::intravisit::walk_expr(self, expr); + walk_expr(self, expr); } } let source_info = self.body.source_info(location);