@@ -82,6 +82,7 @@ use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
82
82
use rustc_hir:: PatKind ;
83
83
use rustc_infer:: infer:: outlives:: env:: OutlivesEnvironment ;
84
84
use rustc_infer:: infer:: { self , RegionObligation , RegionckMode } ;
85
+ use rustc_middle:: hir:: place:: { PlaceBase , PlaceWithHirId } ;
85
86
use rustc_middle:: ty:: adjustment;
86
87
use rustc_middle:: ty:: { self , Ty } ;
87
88
use rustc_span:: Span ;
@@ -442,7 +443,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
442
443
fn constrain_adjustments (
443
444
& mut self ,
444
445
expr : & hir:: Expr < ' _ > ,
445
- ) -> mc:: McResult < mc :: PlaceWithHirId < ' tcx > > {
446
+ ) -> mc:: McResult < PlaceWithHirId < ' tcx > > {
446
447
debug ! ( "constrain_adjustments(expr={:?})" , expr) ;
447
448
448
449
let mut place = self . with_mc ( |mc| mc. cat_expr_unadjusted ( expr) ) ?;
@@ -483,10 +484,10 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
483
484
484
485
fn check_safety_of_rvalue_destructor_if_necessary (
485
486
& mut self ,
486
- place_with_id : & mc :: PlaceWithHirId < ' tcx > ,
487
+ place_with_id : & PlaceWithHirId < ' tcx > ,
487
488
span : Span ,
488
489
) {
489
- if let mc :: PlaceBase :: Rvalue = place_with_id. place . base {
490
+ if let PlaceBase :: Rvalue = place_with_id. place . base {
490
491
if place_with_id. place . projections . is_empty ( ) {
491
492
let typ = self . resolve_type ( place_with_id. place . ty ( ) ) ;
492
493
let body_id = self . body_id ;
@@ -573,7 +574,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
573
574
574
575
/// Link lifetimes of any ref bindings in `root_pat` to the pointers found
575
576
/// in the discriminant, if needed.
576
- fn link_pattern ( & self , discr_cmt : mc :: PlaceWithHirId < ' tcx > , root_pat : & hir:: Pat < ' _ > ) {
577
+ fn link_pattern ( & self , discr_cmt : PlaceWithHirId < ' tcx > , root_pat : & hir:: Pat < ' _ > ) {
577
578
debug ! ( "link_pattern(discr_cmt={:?}, root_pat={:?})" , discr_cmt, root_pat) ;
578
579
ignore_err ! ( self . with_mc( |mc| {
579
580
mc. cat_pattern( discr_cmt, root_pat, |sub_cmt, hir:: Pat { kind, span, hir_id } | {
@@ -594,7 +595,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
594
595
fn link_autoref (
595
596
& self ,
596
597
expr : & hir:: Expr < ' _ > ,
597
- expr_cmt : & mc :: PlaceWithHirId < ' tcx > ,
598
+ expr_cmt : & PlaceWithHirId < ' tcx > ,
598
599
autoref : & adjustment:: AutoBorrow < ' tcx > ,
599
600
) {
600
601
debug ! ( "link_autoref(autoref={:?}, expr_cmt={:?})" , autoref, expr_cmt) ;
@@ -615,7 +616,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
615
616
span : Span ,
616
617
id : hir:: HirId ,
617
618
mutbl : hir:: Mutability ,
618
- cmt_borrowed : & mc :: PlaceWithHirId < ' tcx > ,
619
+ cmt_borrowed : & PlaceWithHirId < ' tcx > ,
619
620
) {
620
621
debug ! (
621
622
"link_region_from_node_type(id={:?}, mutbl={:?}, cmt_borrowed={:?})" ,
@@ -638,7 +639,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
638
639
span : Span ,
639
640
borrow_region : ty:: Region < ' tcx > ,
640
641
borrow_kind : ty:: BorrowKind ,
641
- borrow_place : & mc :: PlaceWithHirId < ' tcx > ,
642
+ borrow_place : & PlaceWithHirId < ' tcx > ,
642
643
) {
643
644
let origin = infer:: DataBorrowed ( borrow_place. place . ty ( ) , span) ;
644
645
self . type_must_outlive ( origin, borrow_place. place . ty ( ) , borrow_region) ;
@@ -659,7 +660,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
659
660
_ => assert ! ( pointer_ty. is_box( ) , "unexpected built-in deref type {}" , pointer_ty) ,
660
661
}
661
662
}
662
- if let mc :: PlaceBase :: Upvar ( upvar_id) = borrow_place. place . base {
663
+ if let PlaceBase :: Upvar ( upvar_id) = borrow_place. place . base {
663
664
self . link_upvar_region ( span, borrow_region, upvar_id) ;
664
665
}
665
666
}
0 commit comments