about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-31 14:46:14 +0200
committerGitHub <noreply@github.com>2024-08-31 14:46:14 +0200
commit830b1deaeec6bff881c4a969ee1e5ddb1c156a0a (patch)
tree3786c5de1594f23563dbc6e1755aacdd5b351140 /compiler/rustc_mir_transform/src
parent5a61a7b904e1ca1b1335ae6076267a6dde64e1b9 (diff)
parentd0aedfbb900309bb633b3ba04bf008183cfdd9a7 (diff)
downloadrust-830b1deaeec6bff881c4a969ee1e5ddb1c156a0a.tar.gz
rust-830b1deaeec6bff881c4a969ee1e5ddb1c156a0a.zip
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
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/add_retag.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/add_retag.rs b/compiler/rustc_mir_transform/src/add_retag.rs
index 12a68790374..79bc21cab14 100644
--- a/compiler/rustc_mir_transform/src/add_retag.rs
+++ b/compiler/rustc_mir_transform/src/add_retag.rs
@@ -137,6 +137,8 @@ impl<'tcx> MirPass<'tcx> for AddRetag {
                                 // Using `is_box_global` here is a bit sketchy: if this code is
                                 // generic over the allocator, we'll not add a retag! This is a hack
                                 // to make Stacked Borrows compatible with custom allocator code.
+                                // It means the raw pointer inherits the tag of the box, which mostly works
+                                // but can sometimes lead to unexpected aliasing errors.
                                 // Long-term, we'll want to move to an aliasing model where "cast to
                                 // raw pointer" is a complete NOP, and then this will no longer be
                                 // an issue.