Auto merge of #111134 - GilShoshan94:remove-send-bound-on-error, r=dtolnay
Remove unnecessary Send bound Hi, While working on a [PR on Tokio](https://github.com/tokio-rs/tokio/pull/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 https://github.com/rust-lang/rust/pull/23541). In the meantime, the `Send` bound `Error` got removed (see https://github.com/rust-lang/rust/pull/21312 and https://github.com/rust-lang/rust/pull/23799). So here a PR to removed this bound for `SendError<T>`, `TrySendError<T>` and `SendTimeoutError<T>`.
This commit is contained in:
commit
3ea9ad5324
@ -35,7 +35,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
}
|
||||
}
|
||||
|
||||
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> {
|
||||
|
@ -1124,7 +1124,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
}
|
||||
|
||||
#[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"
|
||||
@ -1152,7 +1152,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
}
|
||||
|
||||
#[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 {
|
||||
|
Loading…
Reference in New Issue
Block a user