This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 14 files changed +29
-18
lines changed Expand file tree Collapse file tree 14 files changed +29
-18
lines changed Original file line number Diff line number Diff line change @@ -181,9 +181,11 @@ pub enum ErrorKind {
181181 #[ stable( feature = "read_exact" , since = "1.6.0" ) ]
182182 UnexpectedEof ,
183183
184- /// This operation is not supported on this platform.
185- #[ stable( feature = "not_supported_error" , since = "1.52.0" ) ]
186- NotSupported ,
184+ /// This operation is unsupported on this platform.
185+ ///
186+ /// This means that the operation can never succeed.
187+ #[ stable( feature = "unsupported_error" , since = "1.52.0" ) ]
188+ Unsupported ,
187189}
188190
189191impl ErrorKind {
@@ -207,7 +209,7 @@ impl ErrorKind {
207209 ErrorKind :: Interrupted => "operation interrupted" ,
208210 ErrorKind :: Other => "other os error" ,
209211 ErrorKind :: UnexpectedEof => "unexpected end of file" ,
210- ErrorKind :: NotSupported => "not supported " ,
212+ ErrorKind :: Unsupported => "unsupported " ,
211213 }
212214 }
213215}
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ pub fn unsupported<T>() -> crate::io::Result<T> {
5656
5757pub fn unsupported_err ( ) -> crate :: io:: Error {
5858 crate :: io:: Error :: new_const (
59- crate :: io:: ErrorKind :: NotSupported ,
59+ crate :: io:: ErrorKind :: Unsupported ,
6060 & "operation not supported on HermitCore yet" ,
6161 )
6262}
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ pub fn unsupported<T>() -> crate::io::Result<T> {
5050}
5151
5252pub fn unsupported_err ( ) -> crate :: io:: Error {
53- crate :: io:: Error :: new_const ( ErrorKind :: NotSupported , & "operation not supported on SGX yet" )
53+ crate :: io:: Error :: new_const ( ErrorKind :: Unsupported , & "operation not supported on SGX yet" )
5454}
5555
5656/// This function is used to implement various functions that doesn't exist,
Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ impl FileAttr {
366366 }
367367
368368 Err ( io:: Error :: new_const (
369- io:: ErrorKind :: NotSupported ,
369+ io:: ErrorKind :: Unsupported ,
370370 & "creation time is not available on this platform \
371371 currently",
372372 ) )
Original file line number Diff line number Diff line change 11macro_rules! unimpl {
22 ( ) => {
3- return Err ( io:: Error :: new_const( io:: ErrorKind :: NotSupported , & "No networking available on L4Re." ) ) ;
3+ return Err ( io:: Error :: new_const(
4+ io:: ErrorKind :: Unsupported ,
5+ & "No networking available on L4Re." ,
6+ ) ) ;
47 } ;
58}
69
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
148148 libc:: EINVAL => ErrorKind :: InvalidInput ,
149149 libc:: ETIMEDOUT => ErrorKind :: TimedOut ,
150150 libc:: EEXIST => ErrorKind :: AlreadyExists ,
151- libc:: ENOSYS => ErrorKind :: NotSupported ,
151+ libc:: ENOSYS => ErrorKind :: Unsupported ,
152152
153153 // These two constants can have the same value on some systems,
154154 // but different values on others, so we can't use a match
Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
447447#[ cfg( any( target_os = "fuchsia" , target_os = "l4re" ) ) ]
448448pub fn current_exe ( ) -> io:: Result < PathBuf > {
449449 use crate :: io:: ErrorKind ;
450- Err ( io:: Error :: new_const ( ErrorKind :: NotSupported , & "Not yet implemented!" ) )
450+ Err ( io:: Error :: new_const ( ErrorKind :: Unsupported , & "Not yet implemented!" ) )
451451}
452452
453453#[ cfg( target_os = "vxworks" ) ]
Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ pub fn unsupported<T>() -> std_io::Result<T> {
1818}
1919
2020pub fn unsupported_err ( ) -> std_io:: Error {
21- std_io:: Error :: new_const ( std_io:: ErrorKind :: NotSupported , & "operation not supported on this platform" )
21+ std_io:: Error :: new_const (
22+ std_io:: ErrorKind :: Unsupported ,
23+ & "operation not supported on this platform" ,
24+ )
2225}
2326
2427pub fn decode_error_kind ( _code : i32 ) -> crate :: io:: ErrorKind {
Original file line number Diff line number Diff line change @@ -80,11 +80,11 @@ pub fn getenv(_: &OsStr) -> io::Result<Option<OsString>> {
8080}
8181
8282pub fn setenv ( _: & OsStr , _: & OsStr ) -> io:: Result < ( ) > {
83- Err ( io:: Error :: new_const ( io:: ErrorKind :: NotSupported , & "cannot set env vars on this platform" ) )
83+ Err ( io:: Error :: new_const ( io:: ErrorKind :: Unsupported , & "cannot set env vars on this platform" ) )
8484}
8585
8686pub fn unsetenv ( _: & OsStr ) -> io:: Result < ( ) > {
87- Err ( io:: Error :: new_const ( io:: ErrorKind :: NotSupported , & "cannot unset env vars on this platform" ) )
87+ Err ( io:: Error :: new_const ( io:: ErrorKind :: Unsupported , & "cannot unset env vars on this platform" ) )
8888}
8989
9090pub fn temp_dir ( ) -> PathBuf {
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
8383 libc:: EINVAL => ErrorKind :: InvalidInput ,
8484 libc:: ETIMEDOUT => ErrorKind :: TimedOut ,
8585 libc:: EEXIST => ErrorKind :: AlreadyExists ,
86- libc:: ENOSYS => ErrorKind :: NotSupported ,
86+ libc:: ENOSYS => ErrorKind :: Unsupported ,
8787
8888 // These two constants can have the same value on some systems,
8989 // but different values on others, so we can't use a match
You can’t perform that action at this time.
0 commit comments