diff options
| author | Quinn Sinclair <me@partially-typed.dev> | 2024-04-17 13:25:39 +0300 |
|---|---|---|
| committer | blyxyas <blyxyas@gmail.com> | 2024-04-19 23:21:33 +0200 |
| commit | 206b1a1ac9df38ca5278a6db9954f9c62bd34b17 (patch) | |
| tree | 96b889eca48994dfe6e85ab0d342fbbd33ed9c74 /tests/coverage/branch/lazy-boolean.coverage | |
| parent | 2795a6018944a5918b7d276267165484f5d62d6a (diff) | |
| download | rust-206b1a1ac9df38ca5278a6db9954f9c62bd34b17.tar.gz rust-206b1a1ac9df38ca5278a6db9954f9c62bd34b17.zip | |
Threadlocal_initializer_can_be_made_const will not trigger for unreachable initializers
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.
Diffstat (limited to 'tests/coverage/branch/lazy-boolean.coverage')
0 files changed, 0 insertions, 0 deletions
