This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Expand file tree Collapse file tree 2 files changed +6
-16
lines changed Original file line number Diff line number Diff line change @@ -1365,17 +1365,6 @@ impl<'tcx> BasicBlockData<'tcx> {
13651365 self . terminator . as_mut ( ) . expect ( "invalid terminator state" )
13661366 }
13671367
1368- pub fn retain_statements < F > ( & mut self , mut f : F )
1369- where
1370- F : FnMut ( & mut Statement < ' _ > ) -> bool ,
1371- {
1372- for s in & mut self . statements {
1373- if !f ( s) {
1374- s. make_nop ( ) ;
1375- }
1376- }
1377- }
1378-
13791368 pub fn visitable ( & self , index : usize ) -> & dyn MirVisitable < ' tcx > {
13801369 if index < self . statements . len ( ) { & self . statements [ index] } else { & self . terminator }
13811370 }
Original file line number Diff line number Diff line change @@ -393,12 +393,13 @@ impl<'tcx> MutVisitor<'tcx> for TransformVisitor<'tcx> {
393393
394394 fn visit_basic_block_data ( & mut self , block : BasicBlock , data : & mut BasicBlockData < ' tcx > ) {
395395 // Remove StorageLive and StorageDead statements for remapped locals
396- data. retain_statements ( |s| match s. kind {
397- StatementKind :: StorageLive ( l) | StatementKind :: StorageDead ( l) => {
398- !self . remap . contains ( l)
396+ for s in & mut data. statements {
397+ if let StatementKind :: StorageLive ( l) | StatementKind :: StorageDead ( l) = s. kind
398+ && self . remap . contains ( l)
399+ {
400+ s. make_nop ( ) ;
399401 }
400- _ => true ,
401- } ) ;
402+ }
402403
403404 let ret_val = match data. terminator ( ) . kind {
404405 TerminatorKind :: Return => {
You can’t perform that action at this time.
0 commit comments