2023-12-27 14:25:59 +00:00
|
|
|
error: initializer for `thread_local` value can be made `const`
|
2024-06-21 12:53:22 +00:00
|
|
|
--> tests/ui/missing_const_for_thread_local.rs:8:41
|
2023-12-27 14:25:59 +00:00
|
|
|
|
|
|
|
|
LL | static BUF_1: RefCell<String> = RefCell::new(String::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(String::new()) }`
|
|
|
|
|
|
2024-06-21 12:53:22 +00:00
|
|
|
= note: `-D clippy::missing-const-for-thread-local` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::missing_const_for_thread_local)]`
|
2023-12-27 14:25:59 +00:00
|
|
|
|
|
|
|
error: initializer for `thread_local` value can be made `const`
|
2024-06-21 12:53:22 +00:00
|
|
|
--> tests/ui/missing_const_for_thread_local.rs:18:29
|
2023-12-27 14:25:59 +00:00
|
|
|
|
|
|
|
|
LL | static SIMPLE:i32 = 1;
|
|
|
|
| ^ help: replace with: `const { 1 }`
|
|
|
|
|
|
|
|
error: initializer for `thread_local` value can be made `const`
|
2024-06-21 12:53:22 +00:00
|
|
|
--> tests/ui/missing_const_for_thread_local.rs:24:59
|
2023-12-27 14:25:59 +00:00
|
|
|
|
|
|
|
|
LL | static BUF_3_CAN_BE_MADE_CONST: RefCell<String> = RefCell::new(String::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(String::new()) }`
|
|
|
|
|
|
|
|
error: initializer for `thread_local` value can be made `const`
|
2024-06-21 12:53:22 +00:00
|
|
|
--> tests/ui/missing_const_for_thread_local.rs:26:59
|
2023-12-27 14:25:59 +00:00
|
|
|
|
|
|
|
|
LL | static BUF_4_CAN_BE_MADE_CONST: RefCell<String> = RefCell::new(String::new());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(String::new()) }`
|
|
|
|
|
2024-01-21 23:16:47 +00:00
|
|
|
error: initializer for `thread_local` value can be made `const`
|
2024-06-21 12:53:22 +00:00
|
|
|
--> tests/ui/missing_const_for_thread_local.rs:32:31
|
2024-01-21 23:16:47 +00:00
|
|
|
|
|
|
|
|
LL | static PEEL_ME: i32 = { 1 };
|
|
|
|
| ^^^^^ help: replace with: `const { 1 }`
|
|
|
|
|
|
|
|
error: initializer for `thread_local` value can be made `const`
|
2024-06-21 12:53:22 +00:00
|
|
|
--> tests/ui/missing_const_for_thread_local.rs:34:36
|
2024-01-21 23:16:47 +00:00
|
|
|
|
|
|
|
|
LL | static PEEL_ME_MANY: i32 = { let x = 1; x * x };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { { let x = 1; x * x } }`
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2023-12-27 14:25:59 +00:00
|
|
|
|