From ea67d8ba10a7cb0912b9984d8e9759d42046768c Mon Sep 17 00:00:00 2001 From: Vineeth Pillai Date: Wed, 21 Sep 2022 18:43:59 +0000 Subject: [PATCH] audio: Fix the unreachable pattern warning with audio_cras Builds with audio_cras feature gets the following warning warning: unreachable pattern --> src/crosvm/sys/unix/device_helpers.rs:443:9 | 443 | _ => unreachable!(), | ^ | = note: `#[warn(unreachable_patterns)]` on by default This is because the enum is fully matched when audio_cras is enabled. Make the unreachable conditional based on the audio_cras feature. TEST=None BUG=None Change-Id: I68f9d7e4571e043ba81ceef62ced075415398802 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3911098 Commit-Queue: Vineeth Pillai Reviewed-by: Dennis Kempin --- src/crosvm/sys/unix/device_helpers.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crosvm/sys/unix/device_helpers.rs b/src/crosvm/sys/unix/device_helpers.rs index 57900a52be..ad16efcae5 100644 --- a/src/crosvm/sys/unix/device_helpers.rs +++ b/src/crosvm/sys/unix/device_helpers.rs @@ -439,6 +439,7 @@ pub fn create_virtio_snd_device( Backend::NULL => "snd_null_device", #[cfg(feature = "audio_cras")] Backend::Sys(virtio::snd::sys::StreamSourceBackend::CRAS) => "snd_cras_device", + #[cfg(not(feature = "audio_cras"))] _ => unreachable!(), };