diff options
| author | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-21 13:16:10 +0000 |
|---|---|---|
| committer | Oli Scherer <github333195615777966@oli-obk.de> | 2025-07-21 14:23:20 +0000 |
| commit | b2f8b406335310f885a0d2d21ff8472b6a5f9ce5 (patch) | |
| tree | 4bc981747a56c648684a96e59e57b17f28ee433e /compiler/rustc_const_eval | |
| parent | e05ab47e6c418fb2b9faa2eae9a7e70c65c98eaa (diff) | |
Don't ICE on non-TypeId metadata within TypeId
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/memory.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index 20c8e983cea..20825d2ad9b 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -997,7 +997,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { ptr: Pointer<Option<M::Provenance>>, ) -> InterpResult<'tcx, (Ty<'tcx>, u64)> { let (alloc_id, offset, _meta) = self.ptr_get_alloc_id(ptr, 0)?; - let GlobalAlloc::TypeId { ty } = self.tcx.global_alloc(alloc_id) else { + let Some(GlobalAlloc::TypeId { ty }) = self.tcx.try_get_global_alloc(alloc_id) else { throw_ub_format!("invalid `TypeId` value: not all bytes carry type id metadata") }; interp_ok((ty, offset.bytes())) |
