From 5fc736d96d33bc97ec7a3782bca0c4cf8b3f6891 Mon Sep 17 00:00:00 2001 From: Charisee Date: Wed, 3 Apr 2024 20:04:29 +0000 Subject: [PATCH] Update needed for Rust v1.77.1 error: field `0` is never read --> hardware/interfaces/security/keymint/aidl/default/main.rs:38:24 | 38 | 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 | 38 | struct HalServiceError(()); | ~~ error: aborting due to 1 previous err Bug: http://b/330185853 Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image Change-Id: I57f3bd1d702c97929f5fd34f909aa72aa2f2ba02 --- security/keymint/aidl/default/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/keymint/aidl/default/main.rs b/security/keymint/aidl/default/main.rs index ea432d1a26..055c698e2f 100644 --- a/security/keymint/aidl/default/main.rs +++ b/security/keymint/aidl/default/main.rs @@ -44,7 +44,7 @@ impl From for HalServiceError { } fn main() { - if let Err(e) = inner_main() { + if let Err(HalServiceError(e)) = inner_main() { panic!("HAL service failed: {:?}", e); } }