diff options
| author | Ralf Jung <post@ralfj.de> | 2024-07-29 16:40:21 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-08-01 14:25:19 +0200 |
| commit | de78cb56b2fa62b7a5cbb036d05e638dd474c6c3 (patch) | |
| tree | 2b48d53c1139aeb81df1328f19a0bfe86aee5af1 /compiler/rustc_const_eval/src/const_eval | |
| parent | 70591dc15db32941fe3595fdbf98e58d6975f95e (diff) | |
on a signed deref check, mention the right pointer in the error
Diffstat (limited to 'compiler/rustc_const_eval/src/const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/machine.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs index 65cbeab24ec..901149825bf 100644 --- a/compiler/rustc_const_eval/src/const_eval/machine.rs +++ b/compiler/rustc_const_eval/src/const_eval/machine.rs @@ -295,7 +295,7 @@ impl<'tcx> CompileTimeInterpCx<'tcx> { ); } - match self.ptr_try_get_alloc_id(ptr) { + match self.ptr_try_get_alloc_id(ptr, 0) { Ok((alloc_id, offset, _extra)) => { let (_size, alloc_align, _kind) = self.get_alloc_info(alloc_id); @@ -510,7 +510,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> { // If an allocation is created in an another const, // we don't deallocate it. - let (alloc_id, _, _) = ecx.ptr_get_alloc_id(ptr)?; + let (alloc_id, _, _) = ecx.ptr_get_alloc_id(ptr, 0)?; let is_allocated_in_another_const = matches!( ecx.tcx.try_get_global_alloc(alloc_id), Some(interpret::GlobalAlloc::Memory(_)) |
