Skip to content

Commit

Permalink
Auto merge of #111134 - GilShoshan94:remove-send-bound-on-error, r=dt…
Browse files Browse the repository at this point in the history
…olnay

Remove unnecessary Send bound

Hi,

While working on a [PR on Tokio](tokio-rs/tokio#5666), I took inspiration from the std channel mpsc and stumbled on a `Send` bound for a `Error` impl.

Tokio's maintainer `@Darksonn` pointed out to me that `Error` used to required the `Send` bound long time ago (here rust-lang/rust#23541).

In the meantime, the `Send` bound `Error` got removed (see rust-lang/rust#21312 and rust-lang/rust#23799).

So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
  • Loading branch information
bors committed May 16, 2023
2 parents 24a8770 + dec3160 commit 3142e41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion std/src/sync/mpmc/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<T> fmt::Display for SendTimeoutError<T> {
}
}

impl<T: Send> error::Error for SendTimeoutError<T> {}
impl<T> error::Error for SendTimeoutError<T> {}

impl<T> From<SendError<T>> for SendTimeoutError<T> {
fn from(err: SendError<T>) -> SendTimeoutError<T> {
Expand Down
4 changes: 2 additions & 2 deletions std/src/sync/mpsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ impl<T> fmt::Display for SendError<T> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Send> error::Error for SendError<T> {
impl<T> error::Error for SendError<T> {
#[allow(deprecated)]
fn description(&self) -> &str {
"sending on a closed channel"
Expand Down Expand Up @@ -1152,7 +1152,7 @@ impl<T> fmt::Display for TrySendError<T> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Send> error::Error for TrySendError<T> {
impl<T> error::Error for TrySendError<T> {
#[allow(deprecated)]
fn description(&self) -> &str {
match *self {
Expand Down

0 comments on commit 3142e41

Please sign in to comment.