diff options
| author | bors <bors@rust-lang.org> | 2019-10-24 03:38:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-10-24 03:38:57 +0000 |
| commit | 55e00631e5bc5b16d40232914e57deeea197a8e4 (patch) | |
| tree | aa2b50a73237dd118df3faef760be2bf3dd7723f /src/libstd/thread | |
| parent | 4a8c5b20c7772bc5342b83d4b0696ea216ef75a7 (diff) | |
| parent | 3cd7a1740692ec34825d916550141b299caf458b (diff) | |
| download | rust-55e00631e5bc5b16d40232914e57deeea197a8e4.tar.gz rust-55e00631e5bc5b16d40232914e57deeea197a8e4.zip | |
Auto merge of #65733 - Centril:rollup-0zth66f, r=Centril
Rollup of 12 pull requests
Successful merges:
- #64178 (More Clippy fixes for alloc, core and std)
- #65144 (Add Cow::is_borrowed and Cow::is_owned)
- #65193 (Lockless LintStore)
- #65479 (Add the `matches!( $expr, $pat ) -> bool` macro)
- #65518 (Avoid ICE when checking `Destination` of `break` inside a closure)
- #65583 (rustc_metadata: use a table for super_predicates, fn_sig, impl_trait_ref.)
- #65641 (Derive `Rustc{En,De}codable` for `TokenStream`.)
- #65648 (Eliminate `intersect_opt`.)
- #65657 (Remove `InternedString`)
- #65691 (Update E0659 error code long explanation to 2018 edition)
- #65696 (Fix an issue with const inference variables sticking around under Chalk + NLL)
- #65704 (relax ExactSizeIterator bound on write_bytes)
Failed merges:
r? @ghost
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/local.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs index e92c0d1c58e..cfaab4e22e9 100644 --- a/src/libstd/thread/local.rs +++ b/src/libstd/thread/local.rs @@ -509,9 +509,8 @@ pub mod os { pub unsafe fn get(&'static self, init: fn() -> T) -> Option<&'static T> { let ptr = self.os.get() as *mut Value<T>; if ptr as usize > 1 { - match (*ptr).inner.get() { - Some(ref value) => return Some(value), - None => {}, + if let Some(ref value) = (*ptr).inner.get() { + return Some(value); } } self.try_initialize(init) |
