Repository navigation
Emit retags in codegen to support BorrowSanitizer (part 4) - #158100
Conversation
This comment has been minimized.
This comment has been minimized.
| // If the variant contains another variant, then the current block | ||
| // will be different than the one that we created above. We want this | ||
| // block to jump to the terminator block. |
There was a problem hiding this comment.
I don't think this is quite right. For example:
#![crate_type = "lib"]
pub enum Inner {
A(&'static u8),
B(&'static u16),
}
pub enum Outer {
P(&'static u32),
Q(Inner),
}
#[inline(never)]
pub fn demo(_x: Outer) {}produces a block for the Outer::Q case that recurses into the Inner, but that block has no predecessors.
There was a problem hiding this comment.
Good catch! This should be fixed now with 19ba1b0.
commented
Jul 1, 2026
|
@bors squash |
commented
Jul 1, 2026
|
🔑 The |
commented
Jul 1, 2026
|
Oof. @icmccorm Can you combine the commits into perhaps two commits, or check the box that lets maintainers push changes? Then r=me |
19ba1b0 to
c268765
Compare
commented
Jul 2, 2026
|
@saethlin I squashed this into two commits. Since our fork is under an org, GitHub doesn't support letting maintainers make changes, unless I add each individual maintainer to the org. I can add you, if you like. Otherwise, I can just do this from a personal fork in the future. |
commented
Jul 2, 2026
That's very unfortunate. Don't bother changing your workflow around this limitation, I'll just be ready for it in the future :p |
commented
Jul 2, 2026
|
@bors r+ |
commented
Jul 2, 2026
commented
Jul 5, 2026
|
@rust-timer build 6c00b94 |
commented
Jul 5, 2026
|
Missing artifact for sha |
Tracking issue: #154760
Zulip Thread
This is one of several PRs that add experimental support for emitting retags as function calls in codegen.
This PR emits our retag intrinsics based on the structure of a
RetagPlan. The feature works end-to-end now! But, it has two limitations:We do not track interior mutable or pinned ranges precisely. This will come in the next PR, which should be the last one that we need to complete this feature (excluding documentation and compile tests).
We recurse into
repr(simd)types when building aRetagPlan, but we do not emit retags for their fields. We would needBuilderMethods::insert_element, which isn't available. I'm not sure what the best workaround would be for this.Related: #157825, #156210, #156208
Cc: @RalfJung
r? @saethlin