diff options
| author | bors <bors@rust-lang.org> | 2015-04-11 05:57:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-04-11 05:57:55 +0000 |
| commit | 3a8275397a156b17331e16393e5e1ba89ab4de3f (patch) | |
| tree | dacf79fd5ddbc76358b5538e694e2012d4e6a034 /src/libcore | |
| parent | c87ec1edb1a7e449e30b40eba24b912d77dc1f1a (diff) | |
| parent | 76d468ae261bc45582588b972d6098c0edb0d698 (diff) | |
| download | rust-3a8275397a156b17331e16393e5e1ba89ab4de3f.tar.gz rust-3a8275397a156b17331e16393e5e1ba89ab4de3f.zip | |
Auto merge of #24254 - aturon:join-handle-debug, r=alexcrichton
Make `Box<Any + Send>` implement `Debug`. Fixes #21291
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/any.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index 687675f12ef..7025c76d92c 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -114,6 +114,16 @@ impl fmt::Debug for Any { } } +// Ensure that the result of e.g. joining a thread can be printed and +// hence used with `unwrap`. May eventually no longer be needed if +// dispatch works with upcasting. +#[stable(feature = "rust1", since = "1.0.0")] +impl fmt::Debug for Any + Send { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.pad("Any") + } +} + impl Any { /// Returns true if the boxed type is the same as `T` #[stable(feature = "rust1", since = "1.0.0")] |
