Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable a ptr equality test on Miri #79631

Merged
merged 2 commits into from
Dec 4, 2020
Merged

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Dec 2, 2020

This test relies on deduplication of constants. I do not think that this is a guarantee that Rust currently makes, and indeed Miri does not deduplicate constants the same way that rustc does, leading to different behavior in this test.

For now, I propose we simply disable this test in Miri.

@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 2, 2020
@@ -1978,9 +1978,14 @@ fn const_str_ptr() {
const B: &'static [u8; 2] = &A;
const C: *const u8 = B as *const u8;

unsafe {
// Miri does not deduplicate consts (https://github.com/rust-lang/miri/issues/131)
#[cfg(not(miri))]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to have the comment and the attribute on the same line (so that grepping for the attribute also shows explanations) but rustfmt won't let me. :(

@oli-obk
Copy link
Contributor

oli-obk commented Dec 3, 2020

r? @oli-obk

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 3, 2020

📌 Commit 7e74b72 has been approved by oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned dtolnay Dec 3, 2020
@bors 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 Dec 3, 2020
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 3, 2020
disable a ptr equality test on Miri

This test relies on deduplication of constants. I do not think that this is a *guarantee* that Rust currently makes, and indeed Miri does not deduplicate constants the same way that rustc does, leading to different behavior in this test.

For now, I propose we simply disable this test in Miri.
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 4, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#77686 (Render Markdown in search results)
 - rust-lang#79541 (Doc keyword lint pass)
 - rust-lang#79602 (Fix SGX CI)
 - rust-lang#79611 (Use more std:: instead of core:: in docs for consistency)
 - rust-lang#79623 (Pass around Symbols instead of Idents in doctree)
 - rust-lang#79627 (Update cargo)
 - rust-lang#79631 (disable a ptr equality test on Miri)
 - rust-lang#79638 (Use `item_name` instead of pretty printing for resolving `Self` on intra-doc links)
 - rust-lang#79646 (rustc_metadata: Remove some dead code)
 - rust-lang#79664 (move interpret::MemoryKind::Heap to const eval)
 - rust-lang#79678 (Fix some clippy lints)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0a52b43 into rust-lang:master Dec 4, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 4, 2020
@RalfJung RalfJung deleted the miri-const_str_ptr branch December 5, 2020 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants