Update needed for Rust v1.77.1
error: initializer for `thread_local` value can be made `const`
--> system/security/keystore2/src/database.rs:5022:47
|
5022 | static RANDOM_COUNTER: RefCell<i64> = RefCell::new(0);
| ^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(0) }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
= note: `-D clippy::thread-local-initializer-can-be-made-const` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::thread_local_initializer_can_be_made_const)]`
error: aborting due to 1 previous error
Bug: http://b/330185853
Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image
Change-Id: Ic583a76f7ea7fc27ce6c214b3247748d7dbaa1b4
diff --git a/keystore2/src/database.rs b/keystore2/src/database.rs
index 113c049..dd64764 100644
--- a/keystore2/src/database.rs
+++ b/keystore2/src/database.rs
@@ -5019,7 +5019,7 @@
// This allows us to test repeated elements.
thread_local! {
- static RANDOM_COUNTER: RefCell<i64> = RefCell::new(0);
+ static RANDOM_COUNTER: RefCell<i64> = const { RefCell::new(0) };
}
fn reset_random() {