@@ -7,7 +7,7 @@ use rustc_errors::{
7
7
} ;
8
8
use rustc_hir as hir;
9
9
use rustc_hir:: def_id:: DefId ;
10
- use rustc_hir:: intravisit:: { walk_expr, Visitor } ;
10
+ use rustc_hir:: intravisit:: { walk_block , walk_expr, Visitor } ;
11
11
use rustc_hir:: { AsyncGeneratorKind , GeneratorKind } ;
12
12
use rustc_infer:: infer:: TyCtxtInferExt ;
13
13
use rustc_infer:: traits:: ObligationCause ;
@@ -1504,8 +1504,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1504
1504
let mut suggested = false ;
1505
1505
let msg = "consider using a `let` binding to create a longer lived value" ;
1506
1506
1507
- use rustc_hir:: intravisit:: Visitor ;
1508
-
1509
1507
/// We check that there's a single level of block nesting to ensure always correct
1510
1508
/// suggestions. If we don't, then we only provide a free-form message to avoid
1511
1509
/// misleading users in cases like `src/test/ui/nll/borrowed-temporary-error.rs`.
@@ -1520,14 +1518,14 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1520
1518
impl < ' tcx > Visitor < ' tcx > for NestedStatementVisitor {
1521
1519
fn visit_block ( & mut self , block : & hir:: Block < ' tcx > ) {
1522
1520
self . current += 1 ;
1523
- rustc_hir :: intravisit :: walk_block ( self , block) ;
1521
+ walk_block ( self , block) ;
1524
1522
self . current -= 1 ;
1525
1523
}
1526
1524
fn visit_expr ( & mut self , expr : & hir:: Expr < ' tcx > ) {
1527
1525
if self . span == expr. span {
1528
1526
self . found = self . current ;
1529
1527
}
1530
- rustc_hir :: intravisit :: walk_expr ( self , expr) ;
1528
+ walk_expr ( self , expr) ;
1531
1529
}
1532
1530
}
1533
1531
let source_info = self . body . source_info ( location) ;
0 commit comments