From a386aaafb5537dc2b73216e0fe9d57948eab3466 Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Thu, 3 Oct 2024 13:46:54 -0600 Subject: [PATCH] Fix new warning from upcoming deprecation. Since new rustc warns that ! will not decay into () anymore, we need to help the compiler know what types it will be getting from method! macro in 2 places where we call it from set_wifi_debug_mode. https://doc.rust-lang.org/edition-guide/rust-2024/never-type-fallback.html has information about the new warning. Here's the warning we hit without this change: warning: this function depends on never type fallback being `()` --> src/manager/user.rs:189:5 | 189 | / async fn set_wifi_debug_mode( 190 | | &self, 191 | | mode: u32, 192 | | buffer_size: u32, 193 | | #[zbus(signal_context)] ctx: SignalContext<'_>, 194 | | ) -> fdo::Result<()> { | |________________________^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #123748 = help: specify the types explicitly note: in edition 2024, the requirement `!: zbus::zvariant::Type` will fail --> src/manager/user.rs:40:14 | 40 | .call($method, &($($args,)*)) | ^^^^ ... 195 | method!(self, "SetWifiDebugMode", mode, buffer_size)?; | ---------------------------------------------------- in this macro invocation = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default = note: this warning originates in the macro `method` (in Nightly builds, run with -Z macro-backtrace for more info) --- src/manager/user.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/manager/user.rs b/src/manager/user.rs index 5eae61c..ab04900 100644 --- a/src/manager/user.rs +++ b/src/manager/user.rs @@ -192,7 +192,7 @@ impl SteamOSManager { buffer_size: u32, #[zbus(signal_context)] ctx: SignalContext<'_>, ) -> fdo::Result<()> { - method!(self, "SetWifiDebugMode", mode, buffer_size)?; + let _: () = method!(self, "SetWifiDebugMode", mode, buffer_size)?; self.wifi_debug_mode_state_changed(&ctx) .await .map_err(zbus_to_zbus_fdo)?; @@ -466,7 +466,7 @@ impl WifiDebug1 { options: HashMap<&str, zvariant::Value<'_>>, #[zbus(signal_context)] ctx: SignalContext<'_>, ) -> fdo::Result<()> { - method!(self, "SetWifiDebugMode", mode, options)?; + let _: () = method!(self, "SetWifiDebugMode", mode, options)?; self.wifi_debug_mode_state_changed(&ctx) .await .map_err(zbus_to_zbus_fdo)?;