mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
206b1a1ac9
This commit introduces a check to ensure that the lint won't trigger when the initializer is unreachable, such as: ``` thread_local! { static STATE: Cell<usize> = panic!(); } ``` This is achieved by looking at the unpeeled initializer expression and ensuring that the parent macro is not `panic!()`, `todo!()`, `unreachable!()`, `unimplemented!()`. fixes #12637 changelog: [`threadlocal_initializer_can_be_made_const`] will no longer trigger on `unreachable` macros. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |