Skip to content

Commit

Permalink
Rollup merge of #59460 - xfix:include-id-in-thread-debug, r=Amanieu
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cuviper authored Mar 28, 2019
2 parents 4a322f5 + ba21e0b commit a2c4562
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libstd/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit a2c4562

Please sign in to comment.