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.
This commit is contained in:
Josh Stone 2019-03-27 18:15:44 -07:00 committed by GitHub
commit a2c4562690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()
}
}