diff --git a/core/src/muxing.rs b/core/src/muxing.rs index 9987ee964a9d..0c1b9bffd766 100644 --- a/core/src/muxing.rs +++ b/core/src/muxing.rs @@ -81,7 +81,7 @@ pub trait StreamMuxer { type OutboundSubstream; /// Error type of the muxer - type Error; + type Error: std::error::Error + Send + Sync + 'static; /// Polls for a connection-wide event. /// diff --git a/core/src/muxing/boxed.rs b/core/src/muxing/boxed.rs index d6ac3ef735b4..f53f4d00983e 100644 --- a/core/src/muxing/boxed.rs +++ b/core/src/muxing/boxed.rs @@ -39,7 +39,6 @@ impl StreamMuxer for Wrap where T: StreamMuxer, T::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static, - T::Error: Into>, { type Substream = SubstreamBox; type OutboundSubstream = usize; // TODO: use a newtype @@ -100,7 +99,7 @@ where fn into_io_error(err: E) -> io::Error where - E: Into>, + E: Error + Send + Sync + 'static, { io::Error::new(io::ErrorKind::Other, err) } @@ -112,7 +111,6 @@ impl StreamMuxerBox { T: StreamMuxer + Send + Sync + 'static, T::OutboundSubstream: Send, T::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static, - T::Error: Into>, { let wrap = Wrap { inner: muxer, diff --git a/core/src/transport/upgrade.rs b/core/src/transport/upgrade.rs index 9c7fbb4fd005..a20f72129719 100644 --- a/core/src/transport/upgrade.rs +++ b/core/src/transport/upgrade.rs @@ -302,7 +302,6 @@ impl Multiplexed { M: StreamMuxer + Send + Sync + 'static, M::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static, M::OutboundSubstream: Send + 'static, - M::Error: Into>, { boxed(self.map(|(i, m), _| (i, StreamMuxerBox::new(m)))) }