55#![ feature( let_chains) ]
66#![ feature( min_specialization) ]
77#![ feature( never_type) ]
8- #![ feature( once_cell) ]
98#![ feature( rustc_attrs) ]
109#![ feature( stmt_expr_attributes) ]
1110#![ feature( trusted_step) ]
@@ -18,7 +17,6 @@ extern crate rustc_middle;
1817extern crate tracing;
1918
2019use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
21- use rustc_data_structures:: graph:: dominators:: Dominators ;
2220use rustc_data_structures:: vec_map:: VecMap ;
2321use rustc_errors:: { Diagnostic , DiagnosticBuilder } ;
2422use rustc_hir as hir;
@@ -30,7 +28,7 @@ use rustc_middle::mir::{
3028 traversal, Body , ClearCrossCrate , Local , Location , Mutability , NonDivergingIntrinsic , Operand ,
3129 Place , PlaceElem , PlaceRef , VarDebugInfoContents ,
3230} ;
33- use rustc_middle:: mir:: { AggregateKind , BasicBlock , BorrowCheckResult , BorrowKind } ;
31+ use rustc_middle:: mir:: { AggregateKind , BorrowCheckResult , BorrowKind } ;
3432use rustc_middle:: mir:: { Field , ProjectionElem , Promoted , Rvalue , Statement , StatementKind } ;
3533use rustc_middle:: mir:: { InlineAsmOperand , Terminator , TerminatorKind } ;
3634use rustc_middle:: ty:: query:: Providers ;
@@ -40,7 +38,6 @@ use rustc_span::{Span, Symbol};
4038
4139use either:: Either ;
4240use smallvec:: SmallVec ;
43- use std:: cell:: OnceCell ;
4441use std:: cell:: RefCell ;
4542use std:: collections:: BTreeMap ;
4643use std:: rc:: Rc ;
@@ -335,7 +332,6 @@ fn do_mir_borrowck<'tcx>(
335332 used_mut : Default :: default ( ) ,
336333 used_mut_upvars : SmallVec :: new ( ) ,
337334 borrow_set : Rc :: clone ( & borrow_set) ,
338- dominators : Default :: default ( ) ,
339335 upvars : Vec :: new ( ) ,
340336 local_names : IndexVec :: from_elem ( None , & promoted_body. local_decls ) ,
341337 region_names : RefCell :: default ( ) ,
@@ -364,7 +360,6 @@ fn do_mir_borrowck<'tcx>(
364360 used_mut : Default :: default ( ) ,
365361 used_mut_upvars : SmallVec :: new ( ) ,
366362 borrow_set : Rc :: clone ( & borrow_set) ,
367- dominators : Default :: default ( ) ,
368363 upvars,
369364 local_names,
370365 region_names : RefCell :: default ( ) ,
@@ -533,9 +528,6 @@ struct MirBorrowckCtxt<'cx, 'tcx> {
533528 /// The set of borrows extracted from the MIR
534529 borrow_set : Rc < BorrowSet < ' tcx > > ,
535530
536- /// Dominators for MIR
537- dominators : OnceCell < Dominators < BasicBlock > > ,
538-
539531 /// Information about upvars not necessarily preserved in types or MIR
540532 upvars : Vec < Upvar < ' tcx > > ,
541533
@@ -1051,7 +1043,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
10511043
10521044 ( Read ( kind) , BorrowKind :: Unique | BorrowKind :: Mut { .. } ) => {
10531045 // Reading from mere reservations of mutable-borrows is OK.
1054- if !is_active ( this. dominators ( ) , borrow, location) {
1046+ if !is_active ( this. body . basic_blocks . dominators ( ) , borrow, location) {
10551047 assert ! ( allow_two_phase_borrow( borrow. kind) ) ;
10561048 return Control :: Continue ;
10571049 }
@@ -2219,10 +2211,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
22192211 fn is_upvar_field_projection ( & self , place_ref : PlaceRef < ' tcx > ) -> Option < Field > {
22202212 path_utils:: is_upvar_field_projection ( self . infcx . tcx , & self . upvars , place_ref, self . body ( ) )
22212213 }
2222-
2223- fn dominators ( & self ) -> & Dominators < BasicBlock > {
2224- self . dominators . get_or_init ( || self . body . basic_blocks . dominators ( ) )
2225- }
22262214}
22272215
22282216mod error {
0 commit comments