From 5f04340184282496a49ffe1bdbbd01440ea706c9 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sat, 16 May 2026 21:12:31 +0100 Subject: [PATCH] clippy: allow missing_const_for_thread_local false positives --- src/uucore/src/lib/mods/locale.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/uucore/src/lib/mods/locale.rs b/src/uucore/src/lib/mods/locale.rs index 99afc8c0c8a..243ce214d44 100644 --- a/src/uucore/src/lib/mods/locale.rs +++ b/src/uucore/src/lib/mods/locale.rs @@ -112,6 +112,13 @@ static UUCORE_FLUENT: OnceLock = OnceLock::new(); static CHECKSUM_FLUENT: OnceLock = OnceLock::new(); static UTIL_FLUENT: OnceLock = OnceLock::new(); thread_local! { + #[cfg_attr( + target_os = "android", + expect( + clippy::missing_const_for_thread_local, + reason = "https://github.com/rust-lang/rust-clippy/issues/13422" + ) + )] static LOCALIZER: OnceLock = const { OnceLock::new() }; } @@ -465,6 +472,13 @@ fn detect_system_locale() -> Result { pub fn setup_localization(p: &str) -> Result<(), LocalizationError> { // Avoid duplicated and high-cost localizer setup thread_local! { + #[cfg_attr( + target_os = "android", + expect( + clippy::missing_const_for_thread_local, + reason = "https://github.com/rust-lang/rust-clippy/issues/13422" + ) + )] static LOCALIZER_IS_SET: Cell = const { Cell::new(false) }; } if LOCALIZER_IS_SET.with(Cell::get) {