Emit retags in codegen to support BorrowSanitizer (part 3)#157825
Merged
rust-bors[bot] merged 1 commit intoJun 13, 2026
Conversation
Member
|
@bors r+ rollup I understand the separation you did here between building a retag plan and using it, but in general I prefer to reason about code that is used and that I can try out for myself. |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 13, 2026
…uwer Rollup of 5 pull requests Successful merges: - #157518 (Add xdg_basedir API) - #157752 (Rename `errors.rs` file to `diagnostics.rs` (6/N)) - #157769 (Match expressions had not been updated to also show the match_source,…) - #157825 (Emit retags in codegen to support BorrowSanitizer (part 3)) - #157861 (Rename `errors.rs` file to `diagnostics.rs` (7/N))
rust-timer
added a commit
that referenced
this pull request
Jun 13, 2026
Rollup merge of #157825 - BorrowSanitizer:codegen-emit-retag-3, r=saethlin Emit retags in codegen to support BorrowSanitizer (part 3) Tracking issue: #154760 [Zulip Thread](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Staging.20for.20emitting.20retags.20in.20codegen/with/593004012) This is one of several PRs that will add experimental support for emitting retags as function calls in codegen. This PR adds `RetagPlan`, which describes where the pointers that need to be retagged live within the layout of a type. We create a `RetagPlan` ahead of time because only a subset of the variants of a type might contain retagable values. We only want to branch to these variants, and ignore all of the others. If a type can generate a `RetagPlan`, then we will use it as a guide for inserting calls to our retag intrinsics. If a type does not generate a `RetagPlan`, then it does not need to be retagged, and we can skip it. This does not emit a `RetagPlan::EmitRetag` yet. That will come in a subsequent PR. Previous parts: #156208, #156210 cc: @RalfJung r? @saethlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue: #154760
Zulip Thread
This is one of several PRs that will add experimental support for emitting retags as function calls in codegen.
This PR adds
RetagPlan, which describes where the pointers that need to be retagged live within the layout of a type. We create aRetagPlanahead of time because only a subset of the variants of a type might contain retagable values. We only want to branch to these variants, and ignore all of the others. If a type can generate aRetagPlan, then we will use it as a guide for inserting calls to our retag intrinsics. If a type does not generate aRetagPlan, then it does not need to be retagged, and we can skip it.This does not emit a
RetagPlan::EmitRetagyet. That will come in a subsequent PR.Previous parts: #156208, #156210
cc: @RalfJung
r? @saethlin