about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorLinus Färnstrand <faern@faern.net>2019-10-13 11:43:26 +0200
committerLinus Färnstrand <faern@faern.net>2019-10-13 11:43:26 +0200
commitcd0e4c32635cf648f70153f0a25974e687ccd197 (patch)
tree0442afcf984852f385814a56070ba27785d8f3b1 /src/libstd
parent3da6836cc9fd654fa204fe7e113973f7b5b3e5f6 (diff)
downloadrust-cd0e4c32635cf648f70153f0a25974e687ccd197.tar.gz
rust-cd0e4c32635cf648f70153f0a25974e687ccd197.zip
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.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/c_str.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index d7f4cc5d1fd..483f2ba52ec 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)
     }
 }