diff options
| author | Jon Gjengset <jon@thesquareplanet.com> | 2019-11-02 11:12:42 -0400 |
|---|---|---|
| committer | Jon Gjengset <jon@thesquareplanet.com> | 2019-11-02 11:12:42 -0400 |
| commit | 31fc42b7f778accb21db8daaf0f0e725948c9d6d (patch) | |
| tree | 85ddf145a04d381abae1b01906206e83b3813fd9 /src/libstd/thread | |
| parent | 8990f7d627525db934831cc29d5805172d80e156 (diff) | |
| parent | f39205b5d9825fcf35989b5a04d115d411175d18 (diff) | |
| download | rust-31fc42b7f778accb21db8daaf0f0e725948c9d6d.tar.gz rust-31fc42b7f778accb21db8daaf0f0e725948c9d6d.zip | |
Merge branch 'master' into format-temporaries
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/local.rs | 5 | ||||
| -rw-r--r-- | src/libstd/thread/mod.rs | 3 |
2 files changed, 2 insertions, 6 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) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 764041d2f42..0ffa6ace2e4 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -465,12 +465,9 @@ impl Builder { } thread_info::set(imp::guard::current(), their_thread); - #[cfg(feature = "backtrace")] let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| { crate::sys_common::backtrace::__rust_begin_short_backtrace(f) })); - #[cfg(not(feature = "backtrace"))] - let try_result = panic::catch_unwind(panic::AssertUnwindSafe(f)); *their_packet.get() = Some(try_result); }; |
