Repository navigation
Don't allow dereferencing uninitialized references inside PlaceMention - #164812
Jules-Bertholet wants to merge 3 commits into
Conversation
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
e9eb495 to
e6d0a4e
Compare
|
r? @dianne maybe? |
e6d0a4e to
e455b65
Compare
This comment has been minimized.
This comment has been minimized.
e455b65 to
7c1c254
Compare
Co-authored-by: dianne <diannes.gm@gmail.com>
|
I'm going to queue up a crater run, on the assumption that this is done being reviewed, and only needs an FCP and a crater run before merging. @bors try |
This comment has been minimized.
This comment has been minimized.
Don't allow dereferencing dangling refs inside `PlaceMention`
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
cc @rust-lang/miri |
|
I would also like to see a crater run for a stricter version of this that also requires cases where there is no dereference to be initialized. This is necessary for the new MIR semantics for move elimination, which only allocates a local when it is initialized (it doesn't have an address before that point). let a: u32;
_ = a;In this example, |
|
@theemathas Can you cancel this PR's crater run in favor of that one? We can then crater this PR only on the regressions from that run |
|
@craterbot abort |
|
🗑️ Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
@theemathas could you please crater this with the regressions from #165046 (comment)? |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
Since the batch being ran on crater is small: @craterbot p=1 |
|
📝 Configuration of the ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
|
I guess this is ready to go… @rustbot label needs-fcp I-types-nominated |
|
🤖 A dedicated |
|
This PR currently has basically no description, which is unsuitable for a nominated PR. Please explain what exactly is being rejected here, and what is still allowed compared to #165046 (comment). |
PlaceMentionPlaceMention
PlaceMentionPlaceMention
|
This PR rejects dereferences of fully uninitialized or moved-out places, even after Dereferencing a partially moved #165046 (comment) added some restrictions that would be necessary for rust-lang/rfcs#3943. It's not relevant to the immediate soundness fix. |
|
So this PR makes the borrow checker sound under current MIR semantics but not under Amanieu's new semantics? I assume deref of fully moved Boxes also becomes an error?
Seems like a reasonable conservative step as it apparently breaks basically nothing.
|
View all comments
Fixes #164705, fixes #164738
Needs a crater run.
@rustbot label A-borrow-checker