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

Improvements to the README item on -Zmiri-track-raw-pointers. #1748

Merged
merged 3 commits into from
Mar 25, 2021

Conversation

jrvanwhy
Copy link
Contributor

@jrvanwhy jrvanwhy commented Mar 19, 2021

Rendered

Minor change: I changed the quotes around <untagged> into backticks, so they render correctly in markdown.

Significant change: I documented that -Zmiri-track-raw-pointers is a strictly more restrictive model that "normal" Stacked Borrows. I am not confident this change is correct, please verify it. If this change is not correct, let me know, and I'll update this PR to document that :-)

EDIT: I was wrong, -Zmiri-track-raw-pointers may not be strictly more restrictive. I added the following sentence to prevent others from making the same assumption that I did:

Note that it is not currently guaranteed that code that works with -Zmiri-track-raw-pointers also works without -Zmiri-track-raw-pointers.

1. The double quotes around <untagged> are changed to backspaces, so <untagged>
   will render correctly in markdown.
2. Clarify that -Zmiri-track-raw-pointers will never accept code that Miri
   would not have accepted without -Zmiri-track-raw-pointers.
@RalfJung
Copy link
Member

Thanks for the PR!

I documented that -Zmiri-track-raw-pointers is a strictly more restrictive model that "normal" Stacked Borrows. I am not confident this change is correct, please verify it.

I wish this was true, but I am slightly worried that due to rust-lang/unsafe-code-guidelines#273, this might not actually be true...

…estrictive than Stacked Borrows.

This change is based on the following comment:
rust-lang#1748 (comment)
@jrvanwhy
Copy link
Contributor Author

I documented that -Zmiri-track-raw-pointers is a strictly more restrictive model that "normal" Stacked Borrows. I am not confident this change is correct, please verify it.

I wish this was true, but I am slightly worried that due to rust-lang/unsafe-code-guidelines#273, this might not actually be true...

Okay, I replaced the sentence with one that makes it clear it may not be strictly more restrictive. Let me know if you'd like me to squash the commits together, or to add a link to your comment to the README entry.

README.md Outdated Show resolved Hide resolved
`-Zmiri-track-raw-pointers` isn't *much* more restrictive than normal Stacked Borrows.

Co-authored-by: Ralf Jung <post@ralfj.de>
@jrvanwhy
Copy link
Contributor Author

Thanks for the PR!

I documented that -Zmiri-track-raw-pointers is a strictly more restrictive model that "normal" Stacked Borrows. I am not confident this change is correct, please verify it.

I wish this was true, but I am slightly worried that due to rust-lang/unsafe-code-guidelines#273, this might not actually be true...

I have verified that the code in that example runs fine with -Zmiri-track-raw-pointers but Miri detects undefined behavior without -Zmiri-track-raw-pointers, so unfortunately your concern is correct.

@RalfJung
Copy link
Member

I have verified that the code in that example runs fine with -Zmiri-track-raw-pointers but Miri detects undefined behavior without -Zmiri-track-raw-pointers, so unfortunately your concern is correct.

FWIW, note that it is not entirely clear which of the two answers is even correct here. We probably don't want this code to be UB.

@RalfJung
Copy link
Member

Thanks for improving our docs. :)
@bors r+

@bors
Copy link
Contributor

bors commented Mar 25, 2021

📌 Commit 1200561 has been approved by RalfJung

@bors
Copy link
Contributor

bors commented Mar 25, 2021

⌛ Testing commit 1200561 with merge 91aeb04...

@bors
Copy link
Contributor

bors commented Mar 25, 2021

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 91aeb04 to master...

@bors bors merged commit 91aeb04 into rust-lang:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants