We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff8fee1 commit 9a6b611Copy full SHA for 9a6b611
src/libstd/io/error.rs
@@ -37,7 +37,6 @@ pub struct Error {
37
repr: Repr,
38
}
39
40
-#[derive(Debug)]
41
enum Repr {
42
Os(i32),
43
Custom(Box<Custom>),
@@ -240,6 +239,17 @@ impl Error {
240
239
241
242
+impl fmt::Debug for Repr {
243
+ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
244
+ match self {
245
+ &Repr::Os(ref code) =>
246
+ fmt.debug_struct("Os").field("code", code)
247
+ .field("message", &sys::os::error_string(*code)).finish(),
248
+ &Repr::Custom(ref c) => fmt.debug_tuple("Custom").field(c).finish(),
249
+ }
250
251
+}
252
+
253
#[stable(feature = "rust1", since = "1.0.0")]
254
impl fmt::Display for Error {
255
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
0 commit comments