Skip to content

Commit 15d9e2c

Browse files
authored
Rollup merge of rust-lang#121098 - ShoyuVanilla:thread-local-unnecessary-else, 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
2 parents f62d981 + fa1e35c commit 15d9e2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: library/std/src/sys/pal/common/thread_local/fast_local.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ pub macro thread_local_inner {
9494
if let $crate::option::Option::Some(init) = init {
9595
if let $crate::option::Option::Some(value) = init.take() {
9696
return value;
97-
} else if $crate::cfg!(debug_assertions) {
97+
}
98+
if $crate::cfg!(debug_assertions) {
9899
$crate::unreachable!("missing default value");
99100
}
100101
}

0 commit comments

Comments
 (0)