Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions misc/allow-block-list/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@ where
_: ConnectionId,
event: THandlerOutEvent<Self>,
) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down
4 changes: 0 additions & 4 deletions misc/connection-limits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,6 @@ impl NetworkBehaviour for Behaviour {
_: ConnectionId,
event: THandlerOutEvent<Self>,
) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down Expand Up @@ -722,8 +720,6 @@ mod tests {
_connection_id: ConnectionId,
event: THandlerOutEvent<Self>,
) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down
2 changes: 0 additions & 2 deletions misc/memory-connection-limits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ impl NetworkBehaviour for Behaviour {
_: ConnectionId,
event: THandlerOutEvent<Self>,
) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down
2 changes: 0 additions & 2 deletions misc/memory-connection-limits/tests/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ impl<const MEM_PENDING: usize, const MEM_ESTABLISHED: usize> NetworkBehaviour
_: ConnectionId,
event: THandlerOutEvent<Self>,
) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down
2 changes: 0 additions & 2 deletions protocols/autonat/src/v2/client/handler/dial_back.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ impl ConnectionHandler for Handler {
tracing::warn!("Dial back request dropped, too many requests in flight");
}
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { error, .. }) => {
libp2p_core::util::unreachable(error);
}
Expand Down
2 changes: 0 additions & 2 deletions protocols/autonat/src/v2/client/handler/dial_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ async fn start_stream_handle(
.map_err(|e| match e {
StreamUpgradeError::NegotiationFailed => Error::UnsupportedProtocol,
StreamUpgradeError::Timeout => Error::Io(io::ErrorKind::TimedOut.into()),
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
StreamUpgradeError::Apply(v) => libp2p_core::util::unreachable(v),
StreamUpgradeError::Io(e) => Error::Io(e),
})?;
Expand Down
2 changes: 0 additions & 2 deletions protocols/autonat/src/v2/server/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ where
Either::Left(Either::Left(Err(e))) => {
tracing::debug!("dial back error: {e:?}");
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Left(Either::Right(v)) => libp2p_core::util::unreachable(v),
Either::Right(Either::Left(cmd)) => {
let addr = cmd.addr.clone();
Expand Down
2 changes: 0 additions & 2 deletions protocols/autonat/src/v2/server/handler/dial_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ where
);
}
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { error, .. }) => {
tracing::debug!("inbound request failed: {:?}", error);
}
Expand Down
2 changes: 0 additions & 2 deletions protocols/dcutr/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ impl NetworkBehaviour for Behaviour {
.or_default() += 1;
self.queued_events.push_back(ToSwarm::Dial { opts });
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Right(never) => libp2p_core::util::unreachable(never),
};
}
Expand Down
9 changes: 1 addition & 8 deletions protocols/dcutr/src/handler/relayed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ impl Handler {
self.attempts += 1;
}
// A connection listener denies all incoming substreams, thus none can ever be fully
// negotiated. TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
// negotiated.
future::Either::Right(output) => libp2p_core::util::unreachable(output),
}
}
Expand Down Expand Up @@ -154,8 +153,6 @@ impl Handler {
<Self as ConnectionHandler>::InboundProtocol,
>,
) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(error.into_inner());
}

Expand All @@ -167,8 +164,6 @@ impl Handler {
>,
) {
let error = match error {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
StreamUpgradeError::Apply(v) => libp2p_core::util::unreachable(v),
StreamUpgradeError::NegotiationFailed => outbound::Error::Unsupported,
StreamUpgradeError::Io(e) => outbound::Error::Io(e),
Expand Down Expand Up @@ -296,8 +291,6 @@ impl ConnectionHandler for Handler {
ConnectionEvent::FullyNegotiatedOutbound(fully_negotiated_outbound) => {
self.on_fully_negotiated_outbound(fully_negotiated_outbound)
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::ListenUpgradeError(listen_upgrade_error) => {
self.on_listen_upgrade_error(listen_upgrade_error)
}
Expand Down
4 changes: 0 additions & 4 deletions protocols/gossipsub/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ impl ConnectionHandler for Handler {
..
}) => match protocol {
Either::Left(protocol) => handler.on_fully_negotiated_inbound(protocol),
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Right(v) => libp2p_core::util::unreachable(v),
},
ConnectionEvent::FullyNegotiatedOutbound(fully_negotiated_outbound) => {
Expand All @@ -529,8 +527,6 @@ impl ConnectionHandler for Handler {
}) => {
tracing::debug!("Dial upgrade error: Protocol negotiation timeout");
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::DialUpgradeError(DialUpgradeError {
error: StreamUpgradeError::Apply(e),
..
Expand Down
2 changes: 0 additions & 2 deletions protocols/kad/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,6 @@ impl Handler {
// is a `Infallible`.
let protocol = match protocol {
future::Either::Left(p) => p,
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
future::Either::Right(p) => libp2p_core::util::unreachable(p),
};

Expand Down
4 changes: 0 additions & 4 deletions protocols/perf/src/client/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ impl ConnectionHandler for Handler {
event: ConnectionEvent<Self::InboundProtocol, Self::OutboundProtocol>,
) {
match event {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::FullyNegotiatedInbound(FullyNegotiatedInbound {
protocol, ..
}) => libp2p_core::util::unreachable(protocol),
Expand Down Expand Up @@ -143,8 +141,6 @@ impl ConnectionHandler for Handler {
result: Err(error.into()),
}));
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { info: (), error }) => {
libp2p_core::util::unreachable(error)
}
Expand Down
8 changes: 0 additions & 8 deletions protocols/perf/src/server/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ impl ConnectionHandler for Handler {
}

fn on_behaviour_event(&mut self, v: Self::FromBehaviour) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(v)
}

Expand All @@ -97,22 +95,16 @@ impl ConnectionHandler for Handler {
tracing::warn!("Dropping inbound stream because we are at capacity");
}
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::FullyNegotiatedOutbound(FullyNegotiatedOutbound { info, .. }) => {
libp2p_core::util::unreachable(info)
}

// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::DialUpgradeError(DialUpgradeError { info, .. }) => {
libp2p_core::util::unreachable(info)
}
ConnectionEvent::AddressChange(_)
| ConnectionEvent::LocalProtocolsChange(_)
| ConnectionEvent::RemoteProtocolsChange(_) => {}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { info: (), error }) => {
libp2p_core::util::unreachable(error)
}
Expand Down
2 changes: 0 additions & 2 deletions protocols/ping/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ impl Handler {
"ping protocol negotiation timed out",
)),
},
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
StreamUpgradeError::Apply(e) => libp2p_core::util::unreachable(e),
StreamUpgradeError::Io(e) => Failure::Other { error: Box::new(e) },
};
Expand Down
2 changes: 0 additions & 2 deletions protocols/relay/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ impl NetworkBehaviour for Behaviour {
) {
let event = match event {
Either::Left(e) => e,
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Right(v) => libp2p_core::util::unreachable(v),
};

Expand Down
2 changes: 0 additions & 2 deletions protocols/relay/src/behaviour/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ impl Handler {
StreamUpgradeError::Timeout => outbound_stop::Error::Io(io::ErrorKind::TimedOut.into()),
StreamUpgradeError::NegotiationFailed => outbound_stop::Error::Unsupported,
StreamUpgradeError::Io(e) => outbound_stop::Error::Io(e),
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
StreamUpgradeError::Apply(v) => libp2p_core::util::unreachable(v),
};

Expand Down
2 changes: 0 additions & 2 deletions protocols/relay/src/priv_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,6 @@ impl NetworkBehaviour for Behaviour {
) {
let handler_event = match handler_event {
Either::Left(e) => e,
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Right(v) => libp2p_core::util::unreachable(v),
};

Expand Down
6 changes: 0 additions & 6 deletions protocols/relay/src/priv_client/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,6 @@ impl ConnectionHandler for Handler {
let _ = next.send(Ok(ev.protocol));
}
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::ListenUpgradeError(ev) => libp2p_core::util::unreachable(ev.error),
ConnectionEvent::DialUpgradeError(ev) => {
if let Some(next) = self.pending_streams.pop_front() {
Expand Down Expand Up @@ -584,8 +582,6 @@ fn into_reserve_error(e: StreamUpgradeError<Infallible>) -> outbound_hop::Reserv
StreamUpgradeError::Timeout => {
outbound_hop::ReserveError::Io(io::ErrorKind::TimedOut.into())
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
StreamUpgradeError::Apply(never) => libp2p_core::util::unreachable(never),
StreamUpgradeError::NegotiationFailed => outbound_hop::ReserveError::Unsupported,
StreamUpgradeError::Io(e) => outbound_hop::ReserveError::Io(e),
Expand All @@ -597,8 +593,6 @@ fn into_connect_error(e: StreamUpgradeError<Infallible>) -> outbound_hop::Connec
StreamUpgradeError::Timeout => {
outbound_hop::ConnectError::Io(io::ErrorKind::TimedOut.into())
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
StreamUpgradeError::Apply(never) => libp2p_core::util::unreachable(never),
StreamUpgradeError::NegotiationFailed => outbound_hop::ConnectError::Unsupported,
StreamUpgradeError::Io(e) => outbound_hop::ConnectError::Io(e),
Expand Down
2 changes: 0 additions & 2 deletions protocols/request-response/src/cbor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ pub mod codec {

fn decode_into_io_error(err: cbor4ii::serde::DecodeError<Infallible>) -> io::Error {
match err {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
cbor4ii::serde::DecodeError::Core(DecodeError::Read(e)) => {
io::Error::new(io::ErrorKind::Other, e)
}
Expand Down
6 changes: 0 additions & 6 deletions protocols/request-response/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ where
self.pending_events
.push_back(Event::OutboundUnsupportedProtocols(message.request_id));
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
StreamUpgradeError::Apply(e) => libp2p_core::util::unreachable(e),
StreamUpgradeError::Io(e) => {
self.pending_events.push_back(Event::OutboundStreamFailed {
Expand All @@ -254,8 +252,6 @@ where
<Self as ConnectionHandler>::InboundProtocol,
>,
) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(error)
}
}
Expand Down Expand Up @@ -479,8 +475,6 @@ where
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
self.on_dial_upgrade_error(dial_upgrade_error)
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::ListenUpgradeError(listen_upgrade_error) => {
self.on_listen_upgrade_error(listen_upgrade_error)
}
Expand Down
4 changes: 0 additions & 4 deletions protocols/stream/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ impl ConnectionHandler for Handler {
}

fn on_behaviour_event(&mut self, event: Self::FromBehaviour) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down Expand Up @@ -133,8 +131,6 @@ impl ConnectionHandler for Handler {
swarm::StreamUpgradeError::Timeout => {
OpenStreamError::Io(io::Error::from(io::ErrorKind::TimedOut))
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
swarm::StreamUpgradeError::Apply(v) => libp2p_core::util::unreachable(v),
swarm::StreamUpgradeError::NegotiationFailed => {
OpenStreamError::UnsupportedProtocol(p)
Expand Down
4 changes: 0 additions & 4 deletions swarm/src/behaviour/toggle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ where
) {
let out = match out {
future::Either::Left(out) => out,
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
future::Either::Right(v) => libp2p_core::util::unreachable(v),
};

Expand Down Expand Up @@ -254,8 +252,6 @@ where

let err = match err {
Either::Left(e) => e,
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Right(v) => libp2p_core::util::unreachable(v),
};

Expand Down
10 changes: 0 additions & 10 deletions swarm/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1203,23 +1203,17 @@ mod tests {
event: ConnectionEvent<Self::InboundProtocol, Self::OutboundProtocol>,
) {
match event {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::FullyNegotiatedInbound(FullyNegotiatedInbound {
protocol,
..
}) => libp2p_core::util::unreachable(protocol),
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::FullyNegotiatedOutbound(FullyNegotiatedOutbound {
protocol,
..
}) => libp2p_core::util::unreachable(protocol),
ConnectionEvent::DialUpgradeError(DialUpgradeError { error, .. }) => {
self.error = Some(error)
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
ConnectionEvent::AddressChange(_)
| ConnectionEvent::ListenUpgradeError(_)
| ConnectionEvent::LocalProtocolsChange(_)
Expand All @@ -1228,8 +1222,6 @@ mod tests {
}

fn on_behaviour_event(&mut self, event: Self::FromBehaviour) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down Expand Up @@ -1292,8 +1284,6 @@ mod tests {
}

fn on_behaviour_event(&mut self, event: Self::FromBehaviour) {
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
libp2p_core::util::unreachable(event)
}

Expand Down
4 changes: 0 additions & 4 deletions swarm/src/connection/pool/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ pub(crate) async fn new_for_pending_outgoing_connection(
})
.await;
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Left((Ok(v), _)) => libp2p_core::util::unreachable(v),
Either::Right((Ok((address, output, errors)), _)) => {
let _ = events
Expand Down Expand Up @@ -146,8 +144,6 @@ pub(crate) async fn new_for_pending_incoming_connection<TFut>(
})
.await;
}
// TODO: remove when Rust 1.82 is MSRV
#[allow(unreachable_patterns)]
Either::Left((Ok(v), _)) => libp2p_core::util::unreachable(v),
Either::Right((Ok(output), _)) => {
let _ = events
Expand Down
Loading
Loading