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

Make Retag shallow #872

Merged
merged 3 commits into from
Aug 2, 2019
Merged

Make Retag shallow #872

merged 3 commits into from
Aug 2, 2019

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 2, 2019

A shallow retag does not traverse into fields of compound typed to search for references to retag. It only retags "top-level"/"bare" references (and boxes).

This helps with rust-lang/unsafe-code-guidelines#125 because it also means that we do not add protectors for references passed in fields of a struct (or other compound types). Until we know what the rules should be for protectors, I prefer to be less aggressive about what we are rejecting.
This also matches our work-in-progress Coq formalization.

@oli-obk
Copy link
Contributor

oli-obk commented Aug 2, 2019

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 2, 2019

📌 Commit 30fb027 has been approved by oli-obk

@bors
Copy link
Collaborator

bors commented Aug 2, 2019

⌛ Testing commit 30fb027 with merge e00fa96...

bors added a commit that referenced this pull request Aug 2, 2019
Make Retag shallow

A shallow retag does not traverse into fields of compound typed to search for references to retag. It only retags "top-level"/"bare" references (and boxes).

This helps with rust-lang/unsafe-code-guidelines#125 because it also means that we do not add protectors for references passed in fields of a struct (or other compound types). Until we know what the rules should be for protectors, I prefer to be less aggressive about what we are rejecting.
This also matches our work-in-progress Coq formalization.
@bors
Copy link
Collaborator

bors commented Aug 2, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing e00fa96 to master...

@bors bors merged commit 30fb027 into rust-lang:master Aug 2, 2019
@RalfJung RalfJung deleted the retag-shallow branch August 3, 2019 09:15
Centril added a commit to Centril/rust that referenced this pull request Aug 12, 2019
Adapt AddRetag for shallow retagging

With rust-lang/miri#872, Miri only retags "bare" references, not those nested in compound types. This adjust `Retag` statement generation to don't emit retags if they are definitely not a bare reference.

I also expanded the mir-opt test to cover the `Retag` in the drop shim, which had previously not been tested.
Centril added a commit to Centril/rust that referenced this pull request Aug 15, 2019
Adapt AddRetag for shallow retagging

With rust-lang/miri#872, Miri only retags "bare" references, not those nested in compound types. This adjust `Retag` statement generation to don't emit retags if they are definitely not a bare reference.

I also expanded the mir-opt test to cover the `Retag` in the drop shim, which had previously not been tested.
Centril added a commit to Centril/rust that referenced this pull request Aug 15, 2019
Adapt AddRetag for shallow retagging

With rust-lang/miri#872, Miri only retags "bare" references, not those nested in compound types. This adjust `Retag` statement generation to don't emit retags if they are definitely not a bare reference.

I also expanded the mir-opt test to cover the `Retag` in the drop shim, which had previously not been tested.
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