bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.2k stars 3.47k forks source link

missing_const_for_thread_local #15241

Open BenjaminBrienen opened 3 days ago

BenjaminBrienen commented 3 days ago

Bevy version

5a0c09d38fd63383281991da9d6c353ad7228f50

Relevant system information

cargo 1.81.0-nightly (a2b58c3da 2024-07-16) Windows 11

What you did

cargo clippy

What went wrong

warning: initializer for `thread_local` value can be made `const`
   --> crates\bevy_tasks\src\task_pool.rs:118:5
    |
118 | /     thread_local! {
119 | |         static LOCAL_EXECUTOR: async_executor::LocalExecutor<'static> = const { async_executor::LocalExecutor::new() };
120 | |         static THREAD_EXECUTOR: Arc<ThreadExecutor<'static>> = Arc::new(ThreadExecutor::new());
121 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_thread_local
    = note: `#[warn(clippy::missing_const_for_thread_local)]` on by default
    = note: this warning originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: initializer for `thread_local` value can be made `const`
  --> crates\bevy_reflect\src\serde\ser\error_utils.rs:5:1
   |
5  | / thread_local! {
6  | |     /// The thread-local [`TypeInfoStack`] used for debugging.
7  | |     ///
8  | |     /// [`TypeInfoStack`]: crate::type_info_stack::TypeInfoStack
...  |
11 | |     ) };
12 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_thread_local
   = note: this warning originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: initializer for `thread_local` value can be made `const`
  --> crates\bevy_reflect\src\serde\de\error_utils.rs:5:1
   |
5  | / thread_local! {
6  | |     /// The thread-local [`TypeInfoStack`] used for debugging.
7  | |     ///
8  | |     /// [`TypeInfoStack`]: crate::type_info_stack::TypeInfoStack
...  |
11 | |     ) };
12 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_thread_local
   = note: `#[warn(clippy::missing_const_for_thread_local)]` on by default
   = note: this warning originates in the macro `$crate::thread::local_impl::thread_local_inner` which comes from the expansion of the macro `thread_local` (in Nightly builds, run with -Z macro-backtrace for more info)
BenjaminBrienen commented 2 days ago

You can assign this one to me as well