diff options
| author | bors <bors@rust-lang.org> | 2024-01-02 00:27:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-02 00:27:24 +0000 |
| commit | e73bb00542de825567024133711df4f12dd01e31 (patch) | |
| tree | c6c5de6e2a079d24c24c7dbe1fbeb80980899290 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | e1dbafd875f898a14514b39c928e735fb5a7e6b4 (diff) | |
| parent | 70024e16c000edfb56324852414760cc82567217 (diff) | |
| download | rust-e73bb00542de825567024133711df4f12dd01e31.tar.gz rust-e73bb00542de825567024133711df4f12dd01e31.zip | |
Auto merge of #12026 - PartiallyTyped:12015, r=llogiq
New Lint: [`thread_local_initializer_can_be_made_const`] Adds a new lint to suggest using `const` on `thread_local!` initializers that can be evaluated at compile time. Impl details: The lint relies on the expansion of `thread_local!`. For non const-labelled initializers, `thread_local!` produces a function called `__init` that lazily initializes the value. We check the function and decide whether the body can be const. If so, we lint that the initializer value can be made const. changelog: new lint [`thread_local_initializer_can_be_made_const`] fixes: #12015
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
