From 29dc7755357d69d193d1bd4595ea6a35cf73d453 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Mon, 13 Oct 2025 08:25:59 -0400 Subject: [PATCH] test-distro: appease unreachable code check See https://github.com/rust-lang/rust/commit/ff6dc928c5e33ce8e65c6911a7. --- test-distro/src/init.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test-distro/src/init.rs b/test-distro/src/init.rs index 49cc94f2..5833adc0 100644 --- a/test-distro/src/init.rs +++ b/test-distro/src/init.rs @@ -195,6 +195,10 @@ fn main() { } } let how = nix::sys::reboot::RebootMode::RB_POWER_OFF; - let _: std::convert::Infallible = nix::sys::reboot::reboot(how) - .unwrap_or_else(|err| panic!("reboot({how:?}) failed: {err:?}")); + match nix::sys::reboot::reboot(how) { + Ok(infallible) => match infallible {}, + Err(err) => { + panic!("reboot({how:?}) failed: {err:?}") + } + } }