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

Clearly document intentional UB in mir-opt tests #107971

Merged
merged 1 commit into from
Feb 14, 2023

Conversation

saethlin
Copy link
Member

All of the changed mir-opt test input files did not pass Miri. Now they do.

r? @cjgillot because there's a CopyProp test in here that I do not fully understand

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 13, 2023
@JakobDegen
Copy link
Contributor

JakobDegen commented Feb 13, 2023

The UB in all of these tests is intentional. Their goal is to test that despite the fact that Miri believes today that these tests have UB, the optimizations we do do not take advantage of that.

I'd be happy to mark these tests as "no run" or "intentional Miri UB," but we should not change them.

@saethlin
Copy link
Member Author

Yeah. I couldn't figure out what a single one of these tests was testing, which IME is typical of the mir-opt tests.

tests/mir-opt/copy-prop/mutate_through_pointer.rs Outdated Show resolved Hide resolved
tests/mir-opt/sroa.rs Outdated Show resolved Hide resolved
@saethlin saethlin changed the title Fix unintentional UB in mir-opt tests Clearly document intentional UB in mir-opt tests Feb 13, 2023
@RalfJung
Copy link
Member

Yeah. I couldn't figure out what a single one of these tests was testing, which IME is typical of the mir-opt tests.

Yeah I have that problem too. Blessing mir-opt tests can very easily completely destroy what they were intended to test. Cc #85180

@rust-log-analyzer

This comment has been minimized.

tests/mir-opt/sroa.rs Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

Co-authored-by: Jakob Degen <jakob.e.degen@gmail.com>
@cjgillot
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 13, 2023

📌 Commit 614df3f has been approved by cjgillot

It is now in the queue for this repository.

@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 Feb 13, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 13, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#107902 (fix: improve the suggestion on future not awaited)
 - rust-lang#107913 (Update broken link in cargo style guide)
 - rust-lang#107942 (Tighter spans for bad inherent `impl` self types)
 - rust-lang#107948 (Allow shortcuts to directories to be used for ./x.py fmt)
 - rust-lang#107971 (Clearly document intentional UB in mir-opt tests)
 - rust-lang#107985 (Added another error to be processed in fallback)
 - rust-lang#108002 (Update books)
 - rust-lang#108013 (rustdoc: use a string with one-character codes for search index types)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5915309 into rust-lang:master Feb 14, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 14, 2023
@saethlin saethlin deleted the mir-opt-ub branch March 15, 2023 00:33
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.

7 participants