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
This commit is contained in:
Charisee 2024-04-02 16:16:30 +00:00 committed by Charisee Chiw
parent 2fc36745c1
commit 4339115a79

View file

@ -5019,7 +5019,7 @@ pub mod tests {
// 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() {