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

Stacked Borrows: make scalar field retagging the default #2636

Merged
merged 1 commit into from
Oct 29, 2022

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Oct 29, 2022

I think it is time to finally close this soundness gap. Any objections? :)

Unfortunately the latest released versions of hashbrown and scopeguard can fail under full field retagging. The fixes have landed in the git repos but have not been released yet. I don't know if scalar field retagging as enabled by this PR is sufficient to cause problems with these crates, but it seems likely that this would be the case -- e.g. if both value and dropfn are scalars, the entire scopeguard struct will be a ScalarPair and thus get field retagging.

However, given that we actually generate LLVM noalias for these cases, it seems prudent to inform users of this risk. They can easily set -Zmiri-field-retag=none to opt-out of this change.

Cc #2528

Copy link
Member

@saethlin saethlin left a comment

Choose a reason for hiding this comment

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

Yay!

@oli-obk
Copy link
Contributor

oli-obk commented Oct 29, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 29, 2022

📌 Commit 14c247c has been approved by oli-obk

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 29, 2022

⌛ Testing commit 14c247c with merge 7138140...

@bors
Copy link
Collaborator

bors commented Oct 29, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 7138140 to master...

@bors bors merged commit 7138140 into rust-lang:master Oct 29, 2022
@RalfJung RalfJung deleted the scalar-field-retag branch October 30, 2022 08:08
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 11, 2022
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Nov 15, 2022
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.

None yet

4 participants