Skip to content

Commit 3ea9ad5

Browse files
committed
Auto merge of rust-lang#111134 - GilShoshan94:remove-send-bound-on-error, r=dtolnay
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#23541). In the meantime, the `Send` bound `Error` got removed (see rust-lang#21312 and rust-lang#23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
2 parents 76e79ca + af5de85 commit 3ea9ad5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

library/std/src/sync/mpmc/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<T> fmt::Display for SendTimeoutError<T> {
3535
}
3636
}
3737

38-
impl<T: Send> error::Error for SendTimeoutError<T> {}
38+
impl<T> error::Error for SendTimeoutError<T> {}
3939

4040
impl<T> From<SendError<T>> for SendTimeoutError<T> {
4141
fn from(err: SendError<T>) -> SendTimeoutError<T> {

library/std/src/sync/mpsc/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ impl<T> fmt::Display for SendError<T> {
11241124
}
11251125

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

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

0 commit comments

Comments
 (0)