diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index 29b09fcc5274e..8620337280133 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -951,7 +951,7 @@ impl error::Error for Error { ErrorData::Os(..) => None, ErrorData::Simple(..) => None, ErrorData::SimpleMessage(..) => None, - ErrorData::Custom(c) => c.error.cause(), + ErrorData::Custom(c) => Some(&*c.error), } } @@ -960,7 +960,7 @@ impl error::Error for Error { ErrorData::Os(..) => None, ErrorData::Simple(..) => None, ErrorData::SimpleMessage(..) => None, - ErrorData::Custom(c) => c.error.source(), + ErrorData::Custom(c) => Some(&*c.error), } } }