about summary refs log tree commit diff
path: root/tests/coverage/branch/lazy-boolean.coverage
diff options
context:
space:
mode:
authorQuinn Sinclair <me@partially-typed.dev>2024-04-17 13:25:39 +0300
committerblyxyas <blyxyas@gmail.com>2024-04-19 23:21:33 +0200
commit206b1a1ac9df38ca5278a6db9954f9c62bd34b17 (patch)
tree96b889eca48994dfe6e85ab0d342fbbd33ed9c74 /tests/coverage/branch/lazy-boolean.coverage
parent2795a6018944a5918b7d276267165484f5d62d6a (diff)
downloadrust-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