Uh oh!
There was an error while loading. Please reload this page.
make raw_eq precondition more restrictive - #99511
Conversation
rustbot
commented
Jul 20, 2022
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
rust-highfive
commented
Jul 20, 2022
(rust-highfive has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
RalfJung
commented
Aug 3, 2022
14 days without review, let's re-roll the dice... |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Nicholas Nethercote <n.nethercote@gmail.com>
wesleywiser
left a comment
There was a problem hiding this comment.
Is there anything we should do to advertise that the safety invariant (at least, as documented) on this intrinsic has been updated?
wesleywiser
commented
Aug 11, 2022
@bors r+ rollup |
bors
commented
Aug 11, 2022
RalfJung
commented
Aug 11, 2022
I don't think so. It's an intrinsic, and a relatively obscure one. |
…iaskrgr Rollup of 13 pull requests Successful merges: - rust-lang#93896 (rustdoc: make item-infos dimmer on dark theme) - rust-lang#99337 (rustdoc: simplify highlight.rs) - rust-lang#99421 (add crt-static for android) - rust-lang#99500 (Fix flags when using clang as linker for Fuchsia) - rust-lang#99511 (make raw_eq precondition more restrictive) - rust-lang#99992 (Add `x.sh` and `x.ps1` shell scripts) - rust-lang#100112 (Fix test: chunks_mut_are_send_and_sync) - rust-lang#100203 (provide correct size hint for unsupported platform `CommandArgs`) - rust-lang#100307 (Fixrust-lang#96847) - rust-lang#100350 (Stringify non-shorthand visibility correctly) - rust-lang#100374 (Improve crate selection on rustdoc search results page) - rust-lang#100392 (Simplify visitors) - rust-lang#100418 (Add stability attributes to BacktraceStatus variants) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Specifically, don't allow comparing pointers that way. Comparing pointers is subtle because you have to talk about what happens to the provenance.
This matches what Miri already implements, and all existing users are fine with this.
If raw_eq on pointers is ever desired, we can adjust the intrinsic spec and Miri implementation as needed, but for now that seems just unnecessary. Also, this is a const intrinsic, and in const, comparing pointers this way is not possible -- so if we allow the intrinsic to compare pointers in general, we need to impose an extra restrictions saying that in const-context, pointers are not okay.