From 0f42bd4a83f1d120c15c36f57d8f2a3eebf95349 Mon Sep 17 00:00:00 2001 From: Charisee Date: Tue, 2 Apr 2024 03:44:31 +0000 Subject: [PATCH] Update needed for Rust v1.77.0 error: field `0` is never read --> system/core/trusty/keymint/src/keymint_hal_main.rs:40:24 | 40 | struct HalServiceError(String); | --------------- ^^^^^^ | | | field in this struct | = note: `HalServiceError` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis = note: `-D dead-code` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(dead_code)]` help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | 40 | struct HalServiceError(()); | ~~ Bug: http://b/330185853 Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image Change-Id: I79fb9019ba00900508aead414de80edd51f3fa2e --- trusty/keymint/src/keymint_hal_main.rs | 2 +- trusty/secretkeeper/src/hal_main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trusty/keymint/src/keymint_hal_main.rs b/trusty/keymint/src/keymint_hal_main.rs index eda986a45..ef0c598fe 100644 --- a/trusty/keymint/src/keymint_hal_main.rs +++ b/trusty/keymint/src/keymint_hal_main.rs @@ -82,7 +82,7 @@ impl SerializedChannel for TipcChannel { } fn main() { - if let Err(e) = inner_main() { + if let Err(HalServiceError(e)) = inner_main() { panic!("HAL service failed: {:?}", e); } } diff --git a/trusty/secretkeeper/src/hal_main.rs b/trusty/secretkeeper/src/hal_main.rs index df304931d..b31db13df 100644 --- a/trusty/secretkeeper/src/hal_main.rs +++ b/trusty/secretkeeper/src/hal_main.rs @@ -91,7 +91,7 @@ impl SerializedChannel for TipcChannel { } fn main() { - if let Err(e) = inner_main() { + if let Err(HalServiceError(e)) = inner_main() { panic!("HAL service failed: {:?}", e); } }