From 6ea2db7c2d78182fabf66a8c6ffc856446e1cf81 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 27 Sep 2023 11:20:17 +0000 Subject: Strip `OpaqueCast` during `RevealAll`. --- compiler/rustc_const_eval/src/interpret/projection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_const_eval/src') diff --git a/compiler/rustc_const_eval/src/interpret/projection.rs b/compiler/rustc_const_eval/src/interpret/projection.rs index 6c720ac4a57..ca5e19ac1fa 100644 --- a/compiler/rustc_const_eval/src/interpret/projection.rs +++ b/compiler/rustc_const_eval/src/interpret/projection.rs @@ -316,7 +316,7 @@ where { use rustc_middle::mir::ProjectionElem::*; Ok(match proj_elem { - OpaqueCast(ty) => base.transmute(self.layout_of(ty)?, self)?, + OpaqueCast(ty) => bug!("OpaqueCast({ty}) encountered after borrowck"), Field(field, _) => self.project_field(base, field.index())?, Downcast(_, variant) => self.project_downcast(base, variant)?, Deref => self.deref_pointer(&base.to_op(self)?)?.into(), -- cgit 1.4.1-3-g733a5