From cd0e4c32635cf648f70153f0a25974e687ccd197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Sun, 13 Oct 2019 11:43:26 +0200 Subject: [PATCH] Implement Error::source on IntoStringError IntoStringError only implemented Error::cause, which is deprecated. This implemements Error::source instead. Error::cause will still work as before, thanks to the default implementation. --- src/libstd/ffi/c_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index d7f4cc5d1fdaa..483f2ba52eca6 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -919,7 +919,7 @@ impl Error for IntoStringError { "C string contained non-utf8 bytes" } - fn cause(&self) -> Option<&dyn Error> { + fn source(&self) -> Option<&(dyn Error + 'static)> { Some(&self.error) } }