Rollup merge of #129812 - RalfJung:box-custom-alloc, r=compiler-errors
interpret, codegen: tweak some comments and checks regarding Box with custom allocator Cc https://github.com/rust-lang/rust/issues/95453
This commit is contained in:
commit
830b1deaee
4 changed files with 15 additions and 6 deletions
|
@ -438,14 +438,16 @@ where
|
|||
&self,
|
||||
src: &impl Readable<'tcx, M::Provenance>,
|
||||
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::Provenance>> {
|
||||
if src.layout().ty.is_box() {
|
||||
// Derefer should have removed all Box derefs.
|
||||
// Some `Box` are not immediates (if they have a custom allocator)
|
||||
// so the code below would fail.
|
||||
bug!("dereferencing {}", src.layout().ty);
|
||||
}
|
||||
|
||||
let val = self.read_immediate(src)?;
|
||||
trace!("deref to {} on {:?}", val.layout.ty, *val);
|
||||
|
||||
if val.layout.ty.is_box() {
|
||||
// Derefer should have removed all Box derefs
|
||||
bug!("dereferencing {}", val.layout.ty);
|
||||
}
|
||||
|
||||
let mplace = self.ref_to_mplace(&val)?;
|
||||
Ok(mplace)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue