diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-23 15:59:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-23 15:59:30 +0200 |
| commit | 16c10c9145b606ea323b1faa0aa935f0d19ea53b (patch) | |
| tree | 5e389d423afa84b6da7ead3ee6412d72edfc9932 /compiler/rustc_const_eval | |
| parent | 80342618e1f7dfb32b5d35d6fcb204b302e70cdf (diff) | |
| parent | b2f8b406335310f885a0d2d21ff8472b6a5f9ce5 (diff) | |
| download | rust-16c10c9145b606ea323b1faa0aa935f0d19ea53b.tar.gz rust-16c10c9145b606ea323b1faa0aa935f0d19ea53b.zip | |
Rollup merge of #144256 - oli-obk:type-id-ice, r=RalfJung
Don't ICE on non-TypeId metadata within TypeId fixes rust-lang/rust#144253 r? ``````````@RalfJung``````````
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 34297a61648..47bebf5371a 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -1000,7 +1000,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())) |
