Skip to content

Commit

Permalink
Rollup merge of #121098 - ShoyuVanilla:thread-local-unnecessary-else,…
Browse files Browse the repository at this point in the history
… r=Nilstrieb

Remove unnecessary else block from `thread_local!` expanded code

Some expanded codes make ["unnecessary else block" warnings](rust-lang/rust-analyzer#16556 (comment)) for Rust Analyzer
  • Loading branch information
matthiaskrgr authored Feb 15, 2024
2 parents f62d981 + fa1e35c commit 15d9e2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/std/src/sys/pal/common/thread_local/fast_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ pub macro thread_local_inner {
if let $crate::option::Option::Some(init) = init {
if let $crate::option::Option::Some(value) = init.take() {
return value;
} else if $crate::cfg!(debug_assertions) {
}
if $crate::cfg!(debug_assertions) {
$crate::unreachable!("missing default value");
}
}
Expand Down

0 comments on commit 15d9e2c

Please sign in to comment.