add_retag: ensure box-to-raw-ptr casts are preserved for Miri by RalfJung · Pull Request #122647 · rust-lang/rust (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation4 Commits2 Checks0 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
In #122233 I added retag_box_to_raw
not realizing that we can already do addr_of_mut!(*bx)
to turn a box into a raw pointer without an intermediate reference. We just need to ensure this information is preserved past the ElaborateBoxDerefs pass.
r? @oli-obk
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
Relevant to the library team, which will review and decide on the PR/issue.
labels
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
The Miri subtree was changed
cc @rust-lang/miri
&elaborate_box_derefs::ElaborateBoxDerefs, |
---|
&coroutine::StateTransform, |
&add_retag::AddRetag, |
&Lint(known_panics_lint::KnownPanicsLint), |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure what to do with the pass order here. AddRetag
needs to be before ElaborateBoxDerefs
removes all traces of primitive Box derefs. Whether they should be before or after StateTransform
, I don't know. I decided to use the order which doesn't change anything on stable (where AddRetag
is a NOP).
@bors r+ rollup
thanks for the thorough explanations
📌 Commit bcf8015 has been approved by oli-obk
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
add_retag: ensure box-to-raw-ptr casts are preserved for Miri
In rust-lang#122233 I added retag_box_to_raw
not realizing that we can already do addr_of_mut!(*bx)
to turn a box into a raw pointer without an intermediate reference. We just need to ensure this information is preserved past the ElaborateBoxDerefs pass.
r? @oli-obk
This was referenced
Mar 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#122480 (Avoid various uses of
Option<Span>
in favor of usingDUMMY_SP
in the few cases that usedNone
) - rust-lang#122567 (Remove fixme about LLVM basic block naming)
- rust-lang#122588 (less useless filter calls in imported_source_file)
- rust-lang#122647 (add_retag: ensure box-to-raw-ptr casts are preserved for Miri)
- rust-lang#122649 (Update the minimum external LLVM to 17)
- rust-lang#122680 (Do not eat nested expressions' results in
MayContainYieldPoint
format args visitor) - rust-lang#122683 (add missing test: expected paren or brace in macro)
- rust-lang#122689 (Add missing
try_visit
calls in visitors.)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#122647 - RalfJung:box-to-raw-retag, r=oli-obk
add_retag: ensure box-to-raw-ptr casts are preserved for Miri
In rust-lang#122233 I added retag_box_to_raw
not realizing that we can already do addr_of_mut!(*bx)
to turn a box into a raw pointer without an intermediate reference. We just need to ensure this information is preserved past the ElaborateBoxDerefs pass.
r? @oli-obk
This was referenced
Apr 16, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request
Box::into_raw: make Miri understand that this is a box-to-raw cast
Turns out rust-lang#122647 went a bit too far in cleaning up Box
... we still need a hack in Box::into_raw
. The nicer fix would be to make Stacked Borrows not care about reference-to-raw-pointer casts, but it's unclear whether that will ever be possible without going to full Tree Borrows.
Fixes rust-lang/miri#3473.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#124013 - RalfJung:box-to-raw, r=oli-obk
Box::into_raw: make Miri understand that this is a box-to-raw cast
Turns out rust-lang#122647 went a bit too far in cleaning up Box
... we still need a hack in Box::into_raw
. The nicer fix would be to make Stacked Borrows not care about reference-to-raw-pointer casts, but it's unclear whether that will ever be possible without going to full Tree Borrows.
Fixes rust-lang/miri#3473.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request
Box::into_raw: make Miri understand that this is a box-to-raw cast
Turns out rust-lang/rust#122647 went a bit too far in cleaning up Box
... we still need a hack in Box::into_raw
. The nicer fix would be to make Stacked Borrows not care about reference-to-raw-pointer casts, but it's unclear whether that will ever be possible without going to full Tree Borrows.
Fixes #3473.
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.
Relevant to the library team, which will review and decide on the PR/issue.