diff options
| author | joboet <jonasboettiger@icloud.com> | 2024-11-25 13:49:25 +0100 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2024-11-26 18:38:24 +0100 |
| commit | c14d137bfc5133f5a38fad2f58e30fed9c47ffe2 (patch) | |
| tree | 39c74cdea7465778402cd3bcba499b9317d6c606 /library/std/src/io/error.rs | |
| parent | d39afacbdfbc4fb1f8a6dcdb4af7c357bae8f7db (diff) | |
| download | rust-c14d137bfc5133f5a38fad2f58e30fed9c47ffe2.tar.gz rust-c14d137bfc5133f5a38fad2f58e30fed9c47ffe2.zip | |
std: update internal uses of `io::const_error!`
Diffstat (limited to 'library/std/src/io/error.rs')
| -rw-r--r-- | library/std/src/io/error.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/std/src/io/error.rs b/library/std/src/io/error.rs index d98ab35a880..03f38e220a5 100644 --- a/library/std/src/io/error.rs +++ b/library/std/src/io/error.rs @@ -76,31 +76,31 @@ impl fmt::Debug for Error { #[allow(dead_code)] impl Error { pub(crate) const INVALID_UTF8: Self = - const_io_error!(ErrorKind::InvalidData, "stream did not contain valid UTF-8"); + const_error!(ErrorKind::InvalidData, "stream did not contain valid UTF-8"); pub(crate) const READ_EXACT_EOF: Self = - const_io_error!(ErrorKind::UnexpectedEof, "failed to fill whole buffer"); + const_error!(ErrorKind::UnexpectedEof, "failed to fill whole buffer"); - pub(crate) const UNKNOWN_THREAD_COUNT: Self = const_io_error!( + pub(crate) const UNKNOWN_THREAD_COUNT: Self = const_error!( ErrorKind::NotFound, "The number of hardware threads is not known for the target platform" ); pub(crate) const UNSUPPORTED_PLATFORM: Self = - const_io_error!(ErrorKind::Unsupported, "operation not supported on this platform"); + const_error!(ErrorKind::Unsupported, "operation not supported on this platform"); pub(crate) const WRITE_ALL_EOF: Self = - const_io_error!(ErrorKind::WriteZero, "failed to write whole buffer"); + const_error!(ErrorKind::WriteZero, "failed to write whole buffer"); pub(crate) const ZERO_TIMEOUT: Self = - const_io_error!(ErrorKind::InvalidInput, "cannot set a 0 duration timeout"); + const_error!(ErrorKind::InvalidInput, "cannot set a 0 duration timeout"); } #[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") + const_error!(ErrorKind::InvalidInput, "data provided contains a nul byte") } } @@ -603,8 +603,8 @@ impl Error { /// /// This function does not allocate. /// - /// You should not use this directly, and instead use the `const_io_error!` - /// macro: `io::const_io_error!(ErrorKind::Something, "some_message")`. + /// You should not use this directly, and instead use the `const_error!` + /// macro: `io::const_error!(ErrorKind::Something, "some_message")`. /// /// This function should maybe change to `from_static_message<const MSG: &'static /// str>(kind: ErrorKind)` in the future, when const generics allow that. |
