about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-03 17:16:54 -0700
committerGitHub <noreply@github.com>2020-07-03 17:16:54 -0700
commit50dcefca7813a2985c0f1c1863efbe5ce7958815 (patch)
treee8211c5facce88036c5746f4a1691f5b1d0a1ba7
parent4a8d9ea80ff8d7ec4dcc6da7d36fe60ecaa55539 (diff)
parentb4d045719d77e40f294eb85d8e5cf8143d661718 (diff)
downloadrust-50dcefca7813a2985c0f1c1863efbe5ce7958815.tar.gz
rust-50dcefca7813a2985c0f1c1863efbe5ce7958815.zip
Rollup merge of #73693 - wesleywiser:const_prop_exhaustive_match, r=oli-obk
Use exhaustive match in const_prop.rs

Addresses a comment left by @RalfJung on #73613

r? @RalfJung
-rw-r--r--src/librustc_mir/transform/const_prop.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs
index 2c1565b5426..e4c1ca4e851 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