about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-20 12:25:41 +0000
committerbors <bors@rust-lang.org>2024-04-20 12:25:41 +0000
commitc2a98cbfa59bf4136272912aef9ac9af22b34496 (patch)
tree96b889eca48994dfe6e85ab0d342fbbd33ed9c74 /compiler/rustc_codegen_llvm/src
parent2795a6018944a5918b7d276267165484f5d62d6a (diff)
parent206b1a1ac9df38ca5278a6db9954f9c62bd34b17 (diff)
downloadrust-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