diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index b3c4d8c40a10d..8d7f60f9d2c03 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -1625,6 +1625,15 @@ impl error::Error for TrySendError { } } +#[stable(feature = "mpsc_error_conversions", since = "1.23.0")] +impl From> for TrySendError { + fn from(err: SendError) -> TrySendError { + match err { + SendError(t) => TrySendError::Disconnected(t), + } + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Display for RecvError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -1677,7 +1686,7 @@ impl error::Error for TryRecvError { } } -#[stable(feature = "mpsc_recv_error_from", since = "1.23.0")] +#[stable(feature = "mpsc_error_conversions", since = "1.23.0")] impl From for TryRecvError { fn from(err: RecvError) -> TryRecvError { match err { @@ -1718,7 +1727,7 @@ impl error::Error for RecvTimeoutError { } } -#[stable(feature = "mpsc_recv_error_from", since = "1.23.0")] +#[stable(feature = "mpsc_error_conversions", since = "1.23.0")] impl From for RecvTimeoutError { fn from(err: RecvError) -> RecvTimeoutError { match err {