about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorJakob Degen <jakob.e.degen@gmail.com>2022-04-09 10:00:19 -0400
committerJakob Degen <jakob.e.degen@gmail.com>2022-04-11 15:56:04 -0400
commit8732bf5db372e3b9297e854ce71851bbc6a90893 (patch)
tree2bb40ad9fa593e83be209b1ec6aa828415794bdc /compiler/rustc_const_eval/src
parent4bce639c3b98ceb9e8a8896f9d4a7f7d6db79ba1 (diff)
Remove rule that place loads may not happen with variant index set
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/transform/validate.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs
index f153c613f8c..01af9585135 100644
--- a/compiler/rustc_const_eval/src/transform/validate.rs
+++ b/compiler/rustc_const_eval/src/transform/validate.rs
@@ -246,12 +246,9 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
         self.super_projection_elem(local, proj_base, elem, context, location);
     }
 
-    fn visit_place(&mut self, place: &Place<'tcx>, _: PlaceContext, location: Location) {
+    fn visit_place(&mut self, place: &Place<'tcx>, _: PlaceContext, _: Location) {
         // Set off any `bug!`s in the type computation code
-        let ty = place.ty(&self.body.local_decls, self.tcx);
-        if ty.variant_index.is_some() {
-            self.fail(location, "Top level places may not have their variant index set!");
-        }
+        let _ = place.ty(&self.body.local_decls, self.tcx);
     }
 
     fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {