From 672dcbd868198ec6430c90f9d41373cde740dc3d Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Thu, 5 Sep 2024 12:41:19 +1000 Subject: [PATCH] Ignore Rust 1.82 warnings about void patterns (#6357) * Ignore Rust 1.82 warnings about void patterns --- beacon_node/lighthouse_network/gossipsub/src/handler.rs | 4 ++++ beacon_node/lighthouse_network/src/service/mod.rs | 1 + common/warp_utils/src/reject.rs | 2 ++ 3 files changed, 7 insertions(+) diff --git a/beacon_node/lighthouse_network/gossipsub/src/handler.rs b/beacon_node/lighthouse_network/gossipsub/src/handler.rs index 359bf8da42..d89013eb2f 100644 --- a/beacon_node/lighthouse_network/gossipsub/src/handler.rs +++ b/beacon_node/lighthouse_network/gossipsub/src/handler.rs @@ -520,6 +520,7 @@ impl ConnectionHandler for Handler { .. }) => match protocol { Either::Left(protocol) => handler.on_fully_negotiated_inbound(protocol), + #[allow(unreachable_patterns)] Either::Right(v) => void::unreachable(v), }, ConnectionEvent::FullyNegotiatedOutbound(fully_negotiated_outbound) => { @@ -531,6 +532,9 @@ impl ConnectionHandler for Handler { }) => { tracing::debug!("Dial upgrade error: Protocol negotiation timeout"); } + // This pattern is unreachable as of Rust 1.82, we can remove it once the + // MSRV is increased past that version. + #[allow(unreachable_patterns)] ConnectionEvent::DialUpgradeError(DialUpgradeError { error: StreamUpgradeError::Apply(e), .. diff --git a/beacon_node/lighthouse_network/src/service/mod.rs b/beacon_node/lighthouse_network/src/service/mod.rs index a95912ff06..d97b52f79f 100644 --- a/beacon_node/lighthouse_network/src/service/mod.rs +++ b/beacon_node/lighthouse_network/src/service/mod.rs @@ -1809,6 +1809,7 @@ impl Network { self.inject_upnp_event(e); None } + #[allow(unreachable_patterns)] BehaviourEvent::ConnectionLimits(le) => void::unreachable(le), }, SwarmEvent::ConnectionEstablished { .. } => None, diff --git a/common/warp_utils/src/reject.rs b/common/warp_utils/src/reject.rs index 9b28c65212..bbd5274a7e 100644 --- a/common/warp_utils/src/reject.rs +++ b/common/warp_utils/src/reject.rs @@ -265,6 +265,8 @@ pub async fn convert_rejection(res: Result) -> Res Ok(response) => response.into_response(), Err(e) => match handle_rejection(e).await { Ok(reply) => reply.into_response(), + // We can simplify this once Rust 1.82 is MSRV + #[allow(unreachable_patterns)] Err(_) => warp::reply::with_status( warp::reply::json(&"unhandled error"), eth2::StatusCode::INTERNAL_SERVER_ERROR,