From f77d1076ab63dc68c1bce2b8cc08e05b0ea885b0 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 16 Feb 2020 21:12:46 +0100 Subject: [PATCH] Match MIR statements exhaustively --- src/librustc_mir/dataflow/impls/storage_liveness.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/dataflow/impls/storage_liveness.rs b/src/librustc_mir/dataflow/impls/storage_liveness.rs index 7508d71945e..2a7c6c2ffc1 100644 --- a/src/librustc_mir/dataflow/impls/storage_liveness.rs +++ b/src/librustc_mir/dataflow/impls/storage_liveness.rs @@ -129,7 +129,14 @@ impl<'mir, 'tcx> BitDenotation<'tcx> for RequiresStorage<'mir, 'tcx> { sets.gen(place.local); } } - _ => (), + + // Nothing to do for these. Match exhaustively so this fails to compile when new + // variants are added. + StatementKind::AscribeUserType(..) + | StatementKind::FakeRead(..) + | StatementKind::Nop + | StatementKind::Retag(..) + | StatementKind::StorageLive(..) => {} } }