Skip to content

Unify OS specific trait implementations#21654

Merged
bors merged 2 commits intorust-lang:masterfrom
flaper87:unify-impls
Jan 29, 2015
Merged

Unify OS specific trait implementations#21654
bors merged 2 commits intorust-lang:masterfrom
flaper87:unify-impls

Conversation

@flaper87
Copy link
Contributor

Please, look at each commit to see the current differences and the desired result.

Closes: #20260

r? @alexcrichton

There are some explicit Send/Sync implementations for Window's types
that don't exist in Unix. While the end result will be the same, I
believe it's clearer if we keep the explicit implementations consistent
by making the os-specific types Send/Sync where needed and possible.

This commit addresses pipe

src/libstd/sys/unix/pipe.rs
unsafe impl Send for UnixListener {}
unsafe impl Sync for UnixListener {}

src/libstd/sys/windows/pipe.rs
unsafe impl Send for UnixStream {}
unsafe impl Sync for UnixStream {}
unsafe impl Send for UnixListener {}
unsafe impl Sync for UnixListener {}
unsafe impl Send for UnixAcceptor {}
unsafe impl Sync for UnixAcceptor {}
unsafe impl Send for AcceptorState {}
unsafe impl Sync for AcceptorState {}
There are some explicit Send/Sync implementations for Window's types
that don't exist in Unix. While the end result will be the same, I
believe it's clearer if we keep the explicit implementations consistent
by making the os-specific types Send/Sync where needed and possible.

This commit addresses tcp. Existing differences below:

src/libstd/sys/unix/tcp.rs
unsafe impl Sync for TcpListener {}
unsafe impl Sync for AcceptorInner {}

src/libstd/sys/windows/tcp.rs
unsafe impl Send for Event {}
unsafe impl Sync for Event {}
unsafe impl Send for TcpListener {}
unsafe impl Sync for TcpListener {}
unsafe impl Send for TcpAcceptor {}
unsafe impl Sync for TcpAcceptor {}
unsafe impl Send for AcceptorInner {}
unsafe impl Sync for AcceptorInner {}
@alexcrichton
Copy link
Member

@bors: r+ fde4472 rollup

Thanks!

barosl added a commit to barosl/rust that referenced this pull request Jan 27, 2015
Please, look at each commit to see the current differences and the desired result.

Closes: rust-lang#20260

r? @alexcrichton
@bors bors merged commit fde4472 into rust-lang:master Jan 29, 2015
lnicola pushed a commit to lnicola/rust that referenced this pull request Mar 6, 2026
…er-coercion

fix: use `ExprIsRead::Yes` for rhs of binary operators
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.

Unify OS-specific types' trait implementations

3 participants