@@ -76,31 +76,31 @@ impl fmt::Debug for Error {
76
76
#[ allow( dead_code) ]
77
77
impl Error {
78
78
pub ( crate ) const INVALID_UTF8 : Self =
79
- const_io_error ! ( ErrorKind :: InvalidData , "stream did not contain valid UTF-8" ) ;
79
+ const_error ! ( ErrorKind :: InvalidData , "stream did not contain valid UTF-8" ) ;
80
80
81
81
pub ( crate ) const READ_EXACT_EOF : Self =
82
- const_io_error ! ( ErrorKind :: UnexpectedEof , "failed to fill whole buffer" ) ;
82
+ const_error ! ( ErrorKind :: UnexpectedEof , "failed to fill whole buffer" ) ;
83
83
84
- pub ( crate ) const UNKNOWN_THREAD_COUNT : Self = const_io_error ! (
84
+ pub ( crate ) const UNKNOWN_THREAD_COUNT : Self = const_error ! (
85
85
ErrorKind :: NotFound ,
86
86
"The number of hardware threads is not known for the target platform"
87
87
) ;
88
88
89
89
pub ( crate ) const UNSUPPORTED_PLATFORM : Self =
90
- const_io_error ! ( ErrorKind :: Unsupported , "operation not supported on this platform" ) ;
90
+ const_error ! ( ErrorKind :: Unsupported , "operation not supported on this platform" ) ;
91
91
92
92
pub ( crate ) const WRITE_ALL_EOF : Self =
93
- const_io_error ! ( ErrorKind :: WriteZero , "failed to write whole buffer" ) ;
93
+ const_error ! ( ErrorKind :: WriteZero , "failed to write whole buffer" ) ;
94
94
95
95
pub ( crate ) const ZERO_TIMEOUT : Self =
96
- const_io_error ! ( ErrorKind :: InvalidInput , "cannot set a 0 duration timeout" ) ;
96
+ const_error ! ( ErrorKind :: InvalidInput , "cannot set a 0 duration timeout" ) ;
97
97
}
98
98
99
99
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
100
100
impl From < alloc:: ffi:: NulError > for Error {
101
101
/// Converts a [`alloc::ffi::NulError`] into a [`Error`].
102
102
fn from ( _: alloc:: ffi:: NulError ) -> Error {
103
- const_io_error ! ( ErrorKind :: InvalidInput , "data provided contains a nul byte" )
103
+ const_error ! ( ErrorKind :: InvalidInput , "data provided contains a nul byte" )
104
104
}
105
105
}
106
106
@@ -603,8 +603,8 @@ impl Error {
603
603
///
604
604
/// This function does not allocate.
605
605
///
606
- /// You should not use this directly, and instead use the `const_io_error !`
607
- /// macro: `io::const_io_error !(ErrorKind::Something, "some_message")`.
606
+ /// You should not use this directly, and instead use the `const_error !`
607
+ /// macro: `io::const_error !(ErrorKind::Something, "some_message")`.
608
608
///
609
609
/// This function should maybe change to `from_static_message<const MSG: &'static
610
610
/// str>(kind: ErrorKind)` in the future, when const generics allow that.
0 commit comments