Move error trait into core
This commit is contained in:
committed by
Jane Lusby
parent
e0dc8d7801
commit
bf7611d55e
@@ -76,6 +76,15 @@ impl fmt::Debug for Error {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(bootstrap))]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl From<alloc::ffi::NulError> for Error {
|
||||
/// Converts a [`alloc::ffi::NulError`] into a [`Error`].
|
||||
fn from(_: alloc::ffi::NulError) -> Error {
|
||||
const_io_error!(ErrorKind::InvalidInput, "data provided contains a nul byte")
|
||||
}
|
||||
}
|
||||
|
||||
// Only derive debug in tests, to make sure it
|
||||
// doesn't accidentally get printed.
|
||||
#[cfg_attr(test, derive(Debug))]
|
||||
|
||||
Reference in New Issue
Block a user