diff --git a/core/src/muxing.rs b/core/src/muxing.rs index 0c1b9bffd766..71927b463f3b 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: std::error::Error + Send + Sync + 'static; + type Error: std::error::Error; /// Polls for a connection-wide event. /// diff --git a/core/src/muxing/boxed.rs b/core/src/muxing/boxed.rs index f53f4d00983e..f22469ded8dc 100644 --- a/core/src/muxing/boxed.rs +++ b/core/src/muxing/boxed.rs @@ -39,6 +39,7 @@ impl StreamMuxer for Wrap where T: StreamMuxer, T::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static, + T::Error: Send + Sync + 'static, { type Substream = SubstreamBox; type OutboundSubstream = usize; // TODO: use a newtype @@ -111,6 +112,7 @@ impl StreamMuxerBox { T: StreamMuxer + Send + Sync + 'static, T::OutboundSubstream: Send, T::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static, + T::Error: Send + Sync + 'static, { let wrap = Wrap { inner: muxer, diff --git a/core/src/transport/upgrade.rs b/core/src/transport/upgrade.rs index a20f72129719..281171a01117 100644 --- a/core/src/transport/upgrade.rs +++ b/core/src/transport/upgrade.rs @@ -302,6 +302,7 @@ impl Multiplexed { M: StreamMuxer + Send + Sync + 'static, M::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static, M::OutboundSubstream: Send + 'static, + M::Error: Send + Sync + 'static, { boxed(self.map(|(i, m), _| (i, StreamMuxerBox::new(m)))) }