From ba21e0b368d891102c299afe1410dd886598cda4 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Wed, 27 Mar 2019 12:28:17 +0100 Subject: [PATCH] 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. --- src/libstd/thread/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 08f0aa2f0d206..63fa46e2eddd6 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -1256,7 +1256,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() } }