diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-05 22:10:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-05 22:10:02 +0100 |
| commit | b08837f180697b1441d1b9bc374a044d573b83ca (patch) | |
| tree | 3bf9b6e2f7467dd6f571d3306fac22127d54223d /compiler/rustc_codegen_ssa/src | |
| parent | 076043346d7ae779623b3d703c32bb391188d235 (diff) | |
| parent | f391c0793b443d30ef8c4d4228550439d4dbfead (diff) | |
| download | rust-b08837f180697b1441d1b9bc374a044d573b83ca.tar.gz rust-b08837f180697b1441d1b9bc374a044d573b83ca.zip | |
Rollup merge of #122018 - RalfJung:box-custom-alloc, r=oli-obk
only set noalias on Box with the global allocator As discovered in https://github.com/rust-lang/miri/issues/3341, `noalias` and custom allocators don't go well together. rustc can now check whether a Box uses the global allocator. This replaces the previous ad-hoc and rather unprincipled check for a zero-sized allocator. This is the rustc part of fixing that; Miri will also need a patch.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/operand.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 94eb37e78e0..932926976b5 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -204,6 +204,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { pub fn deref<Cx: LayoutTypeMethods<'tcx>>(self, cx: &Cx) -> PlaceRef<'tcx, V> { if self.layout.ty.is_box() { + // Derefer should have removed all Box derefs bug!("dereferencing {:?} in codegen", self.layout.ty); } |
