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

Stabilize unions with `Copy` fields and no destructor #42068

Merged
merged 1 commit into from May 27, 2017

Conversation

Projects
None yet
8 participants
@petrochenkov
Contributor

petrochenkov commented May 17, 2017

What else is needed:

cc #32836
r? @nikomatsakis

@steveklabnik

This comment has been minimized.

Show comment
Hide comment
@steveklabnik

steveklabnik May 18, 2017

Member

Glad to see this becoming stable!

Backport? (The "stabilization decision" is from Apr 13, it's just this PR is late.)

I am not generally a fan of backporting anything that's not crucial.

Member

steveklabnik commented May 18, 2017

Glad to see this becoming stable!

Backport? (The "stabilization decision" is from Apr 13, it's just this PR is late.)

I am not generally a fan of backporting anything that's not crucial.

@carols10cents

This comment has been minimized.

Show comment
Hide comment
@carols10cents

carols10cents May 22, 2017

Member

ping @nikomatsakis, pinging you on IRC too!

Member

carols10cents commented May 22, 2017

ping @nikomatsakis, pinging you on IRC too!

@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
@nikomatsakis

nikomatsakis May 23, 2017

Contributor

I'm waiting on this until #42083 lands.

Contributor

nikomatsakis commented May 23, 2017

I'm waiting on this until #42083 lands.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 24, 2017

Rollup merge of #42083 - petrochenkov:safeassign, r=nikomatsakis
Make assignments to `Copy` union fields safe

This is an accompanying PR to PR rust-lang#42068 stabilizing FFI unions.

This was first proposed in rust-lang#32836 (comment), see subsequent comments as well.
Assignments to `Copy` union fields do not read any data from the union and are [equivalent](rust-lang#32836 (comment)) to whole union assignments, which are safe, so they should be safe as well. This removes a significant number of "false positive" unsafe blocks, in code dealing with FFI unions in particular.

It desirable to make this change now, together with stabilization of FFI unions, because now it affecfts only unstable code, but later it will cause warnings/errors caused by `unused_unsafe` lint in stable code.

cc #32836
r? @nikomatsakis

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 24, 2017

Rollup merge of #42083 - petrochenkov:safeassign, r=nikomatsakis
Make assignments to `Copy` union fields safe

This is an accompanying PR to PR rust-lang#42068 stabilizing FFI unions.

This was first proposed in rust-lang#32836 (comment), see subsequent comments as well.
Assignments to `Copy` union fields do not read any data from the union and are [equivalent](rust-lang#32836 (comment)) to whole union assignments, which are safe, so they should be safe as well. This removes a significant number of "false positive" unsafe blocks, in code dealing with FFI unions in particular.

It desirable to make this change now, together with stabilization of FFI unions, because now it affecfts only unstable code, but later it will cause warnings/errors caused by `unused_unsafe` lint in stable code.

cc #32836
r? @nikomatsakis

bors added a commit that referenced this pull request May 26, 2017

Auto merge of #42083 - petrochenkov:safeassign, r=nikomatsakis
Make assignments to `Copy` union fields safe

This is an accompanying PR to PR #42068 stabilizing FFI unions.

This was first proposed in #32836 (comment), see subsequent comments as well.
Assignments to `Copy` union fields do not read any data from the union and are [equivalent](#32836 (comment)) to whole union assignments, which are safe, so they should be safe as well. This removes a significant number of "false positive" unsafe blocks, in code dealing with FFI unions in particular.

It desirable to make this change now, together with stabilization of FFI unions, because now it affecfts only unstable code, but later it will cause warnings/errors caused by `unused_unsafe` lint in stable code.

cc #32836
r? @nikomatsakis
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors May 26, 2017

Contributor

☔️ The latest upstream changes (presumably #42083) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented May 26, 2017

☔️ The latest upstream changes (presumably #42083) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
@nikomatsakis

nikomatsakis May 26, 2017

Contributor

r=me once rebased

Contributor

nikomatsakis commented May 26, 2017

r=me once rebased

@petrochenkov

This comment has been minimized.

Show comment
Hide comment
@petrochenkov

petrochenkov May 26, 2017

Contributor

@bors r=nikomatsakis

Contributor

petrochenkov commented May 26, 2017

@bors r=nikomatsakis

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors May 26, 2017

Contributor

📌 Commit 73c73e4 has been approved by nikomatsakis

Contributor

bors commented May 26, 2017

📌 Commit 73c73e4 has been approved by nikomatsakis

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors May 26, 2017

Contributor

⌛️ Testing commit 73c73e4 with merge fc26e66...

Contributor

bors commented May 26, 2017

⌛️ Testing commit 73c73e4 with merge fc26e66...

bors added a commit that referenced this pull request May 26, 2017

Auto merge of #42068 - petrochenkov:ustab, r=nikomatsakis
Stabilize unions with `Copy` fields and no destructor

What else is needed:
- [x] Documentation (rust-lang-nursery/reference#57).
- [x] Making assignments to `Copy` union fields safe (#42083).
- [ ] Backport? (The "stabilization decision" is from [Apr 13](#32836 (comment)), it's just this PR is late.)

cc #32836
r? @nikomatsakis
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors May 27, 2017

Contributor

💔 Test failed - status-appveyor

Contributor

bors commented May 27, 2017

💔 Test failed - status-appveyor

@Mark-Simulacrum

This comment has been minimized.

Show comment
Hide comment
@Mark-Simulacrum

Mark-Simulacrum May 27, 2017

Member

@bors retry

  • #41006 - std.dll spurious removal failure
Member

Mark-Simulacrum commented May 27, 2017

@bors retry

  • #41006 - std.dll spurious removal failure
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors May 27, 2017

Contributor

⌛️ Testing commit 73c73e4 with merge 3e7908f...

Contributor

bors commented May 27, 2017

⌛️ Testing commit 73c73e4 with merge 3e7908f...

bors added a commit that referenced this pull request May 27, 2017

Auto merge of #42068 - petrochenkov:ustab, r=nikomatsakis
Stabilize unions with `Copy` fields and no destructor

What else is needed:
- [x] Documentation (rust-lang-nursery/reference#57).
- [x] Making assignments to `Copy` union fields safe (#42083).
- [ ] Backport? (The "stabilization decision" is from [Apr 13](#32836 (comment)), it's just this PR is late.)

cc #32836
r? @nikomatsakis
@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors May 27, 2017

Contributor

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 3e7908f to master...

Contributor

bors commented May 27, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 3e7908f to master...

@bors bors merged commit 73c73e4 into rust-lang:master May 27, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@petrochenkov petrochenkov referenced this pull request May 27, 2017

Open

Untagged unions (tracking issue for RFC 1444) #32836

2 of 5 tasks complete
@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson May 31, 2017

Contributor

Were going to try to backport.

Contributor

brson commented May 31, 2017

Were going to try to backport.

@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson May 31, 2017

Contributor

cc @rust-lang/compiler

Contributor

brson commented May 31, 2017

cc @rust-lang/compiler

bors added a commit that referenced this pull request May 31, 2017

Auto merge of #42321 - brson:beta-next, r=aturon
[beta] Stabilize unions with `Copy` fields and no destructor

- #42068

r? @aturon

cc @petrochenkov
@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
@nikomatsakis

nikomatsakis May 31, 2017

Contributor

@brson I don't strongly object, but I'm surprised you would backport. I feel like we try to keep backports to regressions or important bug fixes, and only rarely backport stabilizations -- the exception would be if some feature is hotly demanded. But otoh this seems pretty darn low risk, so no real objection.

Contributor

nikomatsakis commented May 31, 2017

@brson I don't strongly object, but I'm surprised you would backport. I feel like we try to keep backports to regressions or important bug fixes, and only rarely backport stabilizations -- the exception would be if some feature is hotly demanded. But otoh this seems pretty darn low risk, so no real objection.

@brson

This comment has been minimized.

Show comment
Hide comment
@brson

brson May 31, 2017

Contributor

I closed the backport. It was feeling non-trivial and there wasn't a great deal of agreement about it.

Contributor

brson commented May 31, 2017

I closed the backport. It was feeling non-trivial and there wasn't a great deal of agreement about it.

@pravic pravic referenced this pull request Jun 22, 2017

Open

Untagged unions #10

@willglynn willglynn referenced this pull request Jul 28, 2017

Merged

Drop unstable requirement #1

@petrochenkov petrochenkov deleted the petrochenkov:ustab branch Aug 26, 2017

@idubrov idubrov referenced this pull request Sep 19, 2017

Open

"overloaded" registers #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment