5
5
#![ feature( let_chains) ]
6
6
#![ feature( min_specialization) ]
7
7
#![ feature( never_type) ]
8
- #![ feature( once_cell) ]
9
8
#![ feature( rustc_attrs) ]
10
9
#![ feature( stmt_expr_attributes) ]
11
10
#![ feature( trusted_step) ]
@@ -18,7 +17,6 @@ extern crate rustc_middle;
18
17
extern crate tracing;
19
18
20
19
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
21
- use rustc_data_structures:: graph:: dominators:: Dominators ;
22
20
use rustc_data_structures:: vec_map:: VecMap ;
23
21
use rustc_errors:: { Diagnostic , DiagnosticBuilder } ;
24
22
use rustc_hir as hir;
@@ -30,7 +28,7 @@ use rustc_middle::mir::{
30
28
traversal, Body , ClearCrossCrate , Local , Location , Mutability , NonDivergingIntrinsic , Operand ,
31
29
Place , PlaceElem , PlaceRef , VarDebugInfoContents ,
32
30
} ;
33
- use rustc_middle:: mir:: { AggregateKind , BasicBlock , BorrowCheckResult , BorrowKind } ;
31
+ use rustc_middle:: mir:: { AggregateKind , BorrowCheckResult , BorrowKind } ;
34
32
use rustc_middle:: mir:: { Field , ProjectionElem , Promoted , Rvalue , Statement , StatementKind } ;
35
33
use rustc_middle:: mir:: { InlineAsmOperand , Terminator , TerminatorKind } ;
36
34
use rustc_middle:: ty:: query:: Providers ;
@@ -40,7 +38,6 @@ use rustc_span::{Span, Symbol};
40
38
41
39
use either:: Either ;
42
40
use smallvec:: SmallVec ;
43
- use std:: cell:: OnceCell ;
44
41
use std:: cell:: RefCell ;
45
42
use std:: collections:: BTreeMap ;
46
43
use std:: rc:: Rc ;
@@ -335,7 +332,6 @@ fn do_mir_borrowck<'tcx>(
335
332
used_mut : Default :: default ( ) ,
336
333
used_mut_upvars : SmallVec :: new ( ) ,
337
334
borrow_set : Rc :: clone ( & borrow_set) ,
338
- dominators : Default :: default ( ) ,
339
335
upvars : Vec :: new ( ) ,
340
336
local_names : IndexVec :: from_elem ( None , & promoted_body. local_decls ) ,
341
337
region_names : RefCell :: default ( ) ,
@@ -364,7 +360,6 @@ fn do_mir_borrowck<'tcx>(
364
360
used_mut : Default :: default ( ) ,
365
361
used_mut_upvars : SmallVec :: new ( ) ,
366
362
borrow_set : Rc :: clone ( & borrow_set) ,
367
- dominators : Default :: default ( ) ,
368
363
upvars,
369
364
local_names,
370
365
region_names : RefCell :: default ( ) ,
@@ -533,9 +528,6 @@ struct MirBorrowckCtxt<'cx, 'tcx> {
533
528
/// The set of borrows extracted from the MIR
534
529
borrow_set : Rc < BorrowSet < ' tcx > > ,
535
530
536
- /// Dominators for MIR
537
- dominators : OnceCell < Dominators < BasicBlock > > ,
538
-
539
531
/// Information about upvars not necessarily preserved in types or MIR
540
532
upvars : Vec < Upvar < ' tcx > > ,
541
533
@@ -1051,7 +1043,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1051
1043
1052
1044
( Read ( kind) , BorrowKind :: Unique | BorrowKind :: Mut { .. } ) => {
1053
1045
// 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) {
1055
1047
assert ! ( allow_two_phase_borrow( borrow. kind) ) ;
1056
1048
return Control :: Continue ;
1057
1049
}
@@ -2219,10 +2211,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2219
2211
fn is_upvar_field_projection ( & self , place_ref : PlaceRef < ' tcx > ) -> Option < Field > {
2220
2212
path_utils:: is_upvar_field_projection ( self . infcx . tcx , & self . upvars , place_ref, self . body ( ) )
2221
2213
}
2222
-
2223
- fn dominators ( & self ) -> & Dominators < BasicBlock > {
2224
- self . dominators . get_or_init ( || self . body . basic_blocks . dominators ( ) )
2225
- }
2226
2214
}
2227
2215
2228
2216
mod error {
0 commit comments