diff options
| author | Josh Stone <cuviper@gmail.com> | 2019-03-27 18:15:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-27 18:15:44 -0700 |
| commit | a2c4562690db552c845804223e302d42efd48c98 (patch) | |
| tree | 30dcba1cf4ff7e25de3fd495278e0458ba6c5c98 /src/libstd/thread | |
| parent | 4a322f5fddd91433b6577ccca51249e7beaaafc9 (diff) | |
| parent | ba21e0b368d891102c299afe1410dd886598cda4 (diff) | |
| download | rust-a2c4562690db552c845804223e302d42efd48c98.tar.gz rust-a2c4562690db552c845804223e302d42efd48c98.zip | |
Rollup merge of #59460 - xfix:include-id-in-thread-debug, r=Amanieu
Include id in Thread's Debug implementation Since Rust 1.19.0, `id` is a stable method, so there is no reason to not include it in Debug implementation.
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 6d305aed748..058fee4484d 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -1257,7 +1257,10 @@ impl Thread { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for Thread { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - fmt::Debug::fmt(&self.name(), f) + f.debug_struct("Thread") + .field("id", &self.id()) + .field("name", &self.name()) + .finish() } } |
