diff options
| author | bors <bors@rust-lang.org> | 2024-04-20 12:25:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-20 12:25:41 +0000 |
| commit | c2a98cbfa59bf4136272912aef9ac9af22b34496 (patch) | |
| tree | 96b889eca48994dfe6e85ab0d342fbbd33ed9c74 /compiler/rustc_codegen_llvm/src | |
| parent | 2795a6018944a5918b7d276267165484f5d62d6a (diff) | |
| parent | 206b1a1ac9df38ca5278a6db9954f9c62bd34b17 (diff) | |
| download | rust-c2a98cbfa59bf4136272912aef9ac9af22b34496.tar.gz rust-c2a98cbfa59bf4136272912aef9ac9af22b34496.zip | |
Auto merge of #12685 - m-rph:12637, r=blyxyas
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 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
