From b4d045719d77e40f294eb85d8e5cf8143d661718 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Wed, 24 Jun 2020 08:49:09 -0400 Subject: [PATCH] Use exhaustive match in const_prop.rs --- src/librustc_mir/transform/const_prop.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs index 2c1565b54261c..e4c1ca4e851b0 100644 --- a/src/librustc_mir/transform/const_prop.rs +++ b/src/librustc_mir/transform/const_prop.rs @@ -638,8 +638,20 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { return None; } + Rvalue::ThreadLocalRef(def_id) => { + trace!("skipping ThreadLocalRef({:?})", def_id); - _ => {} + return None; + } + + // There's no other checking to do at this time. + Rvalue::Aggregate(..) + | Rvalue::Use(..) + | Rvalue::Repeat(..) + | Rvalue::Len(..) + | Rvalue::Cast(..) + | Rvalue::Discriminant(..) + | Rvalue::NullaryOp(..) => {} } // FIXME we need to revisit this for #67176