about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-03-01 07:57:09 +0000
committerbors <bors@rust-lang.org>2017-03-01 07:57:09 +0000
commitb671c32ddc8c36d50866428d83b7716233356721 (patch)
treebe000760e8ca562315bf3a95faf32a16bd1c51c4 /src/libstd
parent7ce1fbe1f7fe5cdbec57377d76306e2bc7811bce (diff)
parent0b5bf6744900cdb3bcb82ab35dc760220dd001c6 (diff)
downloadrust-b671c32ddc8c36d50866428d83b7716233356721.tar.gz
rust-b671c32ddc8c36d50866428d83b7716233356721.zip
Auto merge of #40167 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: #39419, #39936, #39944, #39960, #40028, #40128
- Failed merges:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/c_str.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index dc3855367ae..bc678fcb838 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -455,6 +455,20 @@ impl From<NulError> for io::Error {
     }
 }
 
+#[stable(feature = "frombyteswithnulerror_impls", since = "1.17.0")]
+impl Error for FromBytesWithNulError {
+    fn description(&self) -> &str {
+        "data provided is not null terminated or contains an interior nul byte"
+    }
+}
+
+#[stable(feature = "frombyteswithnulerror_impls", since = "1.17.0")]
+impl fmt::Display for FromBytesWithNulError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        self.description().fmt(f)
+    }
+}
+
 impl IntoStringError {
     /// Consumes this error, returning original `CString` which generated the
     /// error.