Rollup merge of #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](https://github.com/rust-lang/rust-analyzer/issues/16556#issuecomment-1944271716) for Rust Analyzer
This commit is contained in:
Matthias Krüger 2024-02-15 09:20:20 +01:00 committed by GitHub
commit 15d9e2c0f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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");
}
}