File tree 2 files changed +6
-3
lines changed
rustc_data_structures/src/graph/dominators
rustc_mir/src/borrow_check
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ pub struct Dominators<N: Idx> {
85
85
}
86
86
87
87
impl < Node : Idx > Dominators < Node > {
88
+ pub fn dummy ( ) -> Self {
89
+ Self { post_order_rank : IndexVec :: new ( ) , immediate_dominators : IndexVec :: new ( ) }
90
+ }
91
+
88
92
pub fn is_reachable ( & self , node : Node ) -> bool {
89
93
self . immediate_dominators [ node] . is_some ( )
90
94
}
Original file line number Diff line number Diff line change @@ -266,15 +266,14 @@ fn do_mir_borrowck<'a, 'tcx>(
266
266
267
267
for ( idx, move_data_results) in promoted_errors {
268
268
let promoted_body = & promoted[ idx] ;
269
- let dominators = promoted_body. dominators ( ) ;
270
269
271
270
if let Err ( ( move_data, move_errors) ) = move_data_results {
272
271
let mut promoted_mbcx = MirBorrowckCtxt {
273
272
infcx,
274
273
param_env,
275
274
body : promoted_body,
276
275
move_data : & move_data,
277
- location_table : & LocationTable :: new ( promoted_body ) ,
276
+ location_table, // no need to create a real one for the promoted, it is not used
278
277
movable_generator,
279
278
fn_self_span_reported : Default :: default ( ) ,
280
279
locals_are_invalidated_at_exit,
@@ -288,7 +287,7 @@ fn do_mir_borrowck<'a, 'tcx>(
288
287
used_mut : Default :: default ( ) ,
289
288
used_mut_upvars : SmallVec :: new ( ) ,
290
289
borrow_set : Rc :: clone ( & borrow_set) ,
291
- dominators,
290
+ dominators : Dominators :: dummy ( ) , // not used
292
291
upvars : Vec :: new ( ) ,
293
292
local_names : IndexVec :: from_elem ( None , & promoted_body. local_decls ) ,
294
293
region_names : RefCell :: default ( ) ,
You can’t perform that action at this time.
0 commit comments