Skip to content

Remove 'static bound from sync::mpsc, Mutex and RwLock. #22574

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

Merged
merged 1 commit into from
Feb 22, 2015

Conversation

huonw
Copy link
Member

@huonw huonw commented Feb 20, 2015

Add a basic test that checks that the types catch the most glaring
errors that could occur.

cc #22444

@rust-highfive
Copy link
Contributor

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@huonw huonw force-pushed the remove-lame-statics branch from 9eaf9a0 to 299cdc9 Compare February 20, 2015 12:13
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 20, 2015
This commit removes many unnecessary `unsafe impl` blocks as well as pushing the
needed implementations to the lowest level possible. I noticed that the bounds
for `RwLock` are a little off when reviewing rust-lang#22574 and wanted to ensure that we
had our story straight on these implementations.
@@ -64,8 +64,8 @@ pub struct RwLock<T> {
data: UnsafeCell<T>,
}

unsafe impl<T:'static+Send> Send for RwLock<T> {}
unsafe impl<T> Sync for RwLock<T> {}
Copy link
Member

Choose a reason for hiding this comment

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

I'm... a little shocked by this!

Copy link
Member Author

Choose a reason for hiding this comment

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

I was also surprised that RwLock previously had such loose bounds, however, I think it was impossible to construct one that didn't satisfy them, so it has probably not mattered (fortunately).

@alexcrichton
Copy link
Member

The changes to Mutex and RwLock seem totally fine to me. I'm don't personally feel comfortable signing off on the mpsc changes, so I'd like a second opinion.

@huonw huonw force-pushed the remove-lame-statics branch from 299cdc9 to 1fd17f7 Compare February 21, 2015 05:29
@alexcrichton
Copy link
Member

Ok I talked with @aturon tonight and he agreed that this should be ok. r=me with the new test case to trigger an error in the mpsc case.

Adds some basic tests to check that the types still catch the most
glaring errors that could occur.

cc rust-lang#22444.
@huonw huonw force-pushed the remove-lame-statics branch from 1fd17f7 to 380d23b Compare February 21, 2015 05:51
@huonw
Copy link
Member Author

huonw commented Feb 21, 2015

@bors r=alexcirchton 380d

@bors
Copy link
Collaborator

bors commented Feb 22, 2015

⌛ Testing commit 380d23b with merge dcc6ce2...

bors added a commit that referenced this pull request Feb 22, 2015
Add a basic test that checks that the types catch the most glaring
errors that could occur.

cc #22444
@bors bors merged commit 380d23b into rust-lang:master Feb 22, 2015
@huonw huonw deleted the remove-lame-statics branch February 22, 2015 13:30
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 25, 2015
 This commit removes many unnecessary `unsafe impl` blocks as well as pushing the
needed implementations to the lowest level possible. I noticed that the bounds
for `RwLock` are a little off when reviewing rust-lang#22574 and wanted to ensure that we
had our story straight on these implementations.
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.

5 participants