From 9f9c31171888150912487d97dba19c6586007310 Mon Sep 17 00:00:00 2001 From: DrMeepster <19316085+DrMeepster@users.noreply.github.com> Date: Tue, 28 Jun 2022 02:19:52 -0700 Subject: [PATCH] Validate all fields of box instead of validating allocator specifically --- compiler/rustc_const_eval/src/interpret/validity.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 00e4472721f3f..702954884a08b 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -599,8 +599,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, ' let ptr = self.ecx.operand_field(&nonnull, 0)?; self.check_safe_pointer(&ptr, "box")?; - let allocator = self.ecx.operand_field(value, 1)?; - self.visit_field(value, 1, &allocator)?; + // Check other fields of Box + self.walk_value(op)?; Ok(true) } ty::FnPtr(_sig) => {