@@ -276,7 +276,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
276
276
PlaceContext :: MutatingUse ( MutatingUseContext :: Borrow )
277
277
}
278
278
} ;
279
- self . visit_place_base ( & place. local , ctx, location) ;
279
+ self . visit_local ( & place. local , ctx, location) ;
280
280
self . visit_projection ( place. local , reborrowed_proj, ctx, location) ;
281
281
return ;
282
282
}
@@ -289,7 +289,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
289
289
}
290
290
Mutability :: Mut => PlaceContext :: MutatingUse ( MutatingUseContext :: AddressOf ) ,
291
291
} ;
292
- self . visit_place_base ( & place. local , ctx, location) ;
292
+ self . visit_local ( & place. local , ctx, location) ;
293
293
self . visit_projection ( place. local , reborrowed_proj, ctx, location) ;
294
294
return ;
295
295
}
@@ -386,14 +386,13 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
386
386
}
387
387
}
388
388
389
- fn visit_place_base ( & mut self , place_local : & Local , context : PlaceContext , location : Location ) {
389
+ fn visit_local ( & mut self , place_local : & Local , context : PlaceContext , location : Location ) {
390
390
trace ! (
391
- "visit_place_base : place_local={:?} context={:?} location={:?}" ,
391
+ "visit_local : place_local={:?} context={:?} location={:?}" ,
392
392
place_local,
393
393
context,
394
394
location,
395
395
) ;
396
- self . super_place_base ( place_local, context, location) ;
397
396
}
398
397
399
398
fn visit_operand ( & mut self , op : & Operand < ' tcx > , location : Location ) {
@@ -478,14 +477,24 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
478
477
StatementKind :: Assign ( ..) | StatementKind :: SetDiscriminant { .. } => {
479
478
self . super_statement ( statement, location) ;
480
479
}
481
- StatementKind :: FakeRead ( FakeReadCause :: ForMatchedPlace , _) => {
480
+
481
+ StatementKind :: FakeRead (
482
+ FakeReadCause :: ForMatchedPlace
483
+ | FakeReadCause :: ForMatchGuard
484
+ | FakeReadCause :: ForGuardBinding ,
485
+ _,
486
+ ) => {
487
+ self . super_statement ( statement, location) ;
482
488
self . check_op ( ops:: IfOrMatch ) ;
483
489
}
484
- // FIXME(eddyb) should these really do nothing?
485
- StatementKind :: FakeRead ( ..)
490
+ StatementKind :: LlvmInlineAsm { .. } => {
491
+ self . super_statement ( statement, location) ;
492
+ self . check_op ( ops:: InlineAsm ) ;
493
+ }
494
+
495
+ StatementKind :: FakeRead ( FakeReadCause :: ForLet | FakeReadCause :: ForIndex , _)
486
496
| StatementKind :: StorageLive ( _)
487
497
| StatementKind :: StorageDead ( _)
488
- | StatementKind :: LlvmInlineAsm { .. }
489
498
| StatementKind :: Retag { .. }
490
499
| StatementKind :: AscribeUserType ( ..)
491
500
| StatementKind :: Nop => { }
@@ -572,7 +581,19 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
572
581
}
573
582
}
574
583
575
- _ => { }
584
+ // FIXME: Some of these are only caught by `min_const_fn`, but should error here
585
+ // instead.
586
+ TerminatorKind :: Abort
587
+ | TerminatorKind :: Assert { .. }
588
+ | TerminatorKind :: FalseEdges { .. }
589
+ | TerminatorKind :: FalseUnwind { .. }
590
+ | TerminatorKind :: GeneratorDrop
591
+ | TerminatorKind :: Goto { .. }
592
+ | TerminatorKind :: Resume
593
+ | TerminatorKind :: Return
594
+ | TerminatorKind :: SwitchInt { .. }
595
+ | TerminatorKind :: Unreachable
596
+ | TerminatorKind :: Yield { .. } => { }
576
597
}
577
598
}
578
599
}
0 commit comments