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 {
181
181
#[ stable( feature = "read_exact" , since = "1.6.0" ) ]
182
182
UnexpectedEof ,
183
183
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 ,
187
189
}
188
190
189
191
impl ErrorKind {
@@ -207,7 +209,7 @@ impl ErrorKind {
207
209
ErrorKind :: Interrupted => "operation interrupted" ,
208
210
ErrorKind :: Other => "other os error" ,
209
211
ErrorKind :: UnexpectedEof => "unexpected end of file" ,
210
- ErrorKind :: NotSupported => "not supported " ,
212
+ ErrorKind :: Unsupported => "unsupported " ,
211
213
}
212
214
}
213
215
}
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ pub fn unsupported<T>() -> crate::io::Result<T> {
56
56
57
57
pub fn unsupported_err ( ) -> crate :: io:: Error {
58
58
crate :: io:: Error :: new_const (
59
- crate :: io:: ErrorKind :: NotSupported ,
59
+ crate :: io:: ErrorKind :: Unsupported ,
60
60
& "operation not supported on HermitCore yet" ,
61
61
)
62
62
}
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ pub fn unsupported<T>() -> crate::io::Result<T> {
50
50
}
51
51
52
52
pub 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" )
54
54
}
55
55
56
56
/// 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 {
366
366
}
367
367
368
368
Err ( io:: Error :: new_const (
369
- io:: ErrorKind :: NotSupported ,
369
+ io:: ErrorKind :: Unsupported ,
370
370
& "creation time is not available on this platform \
371
371
currently",
372
372
) )
Original file line number Diff line number Diff line change 1
1
macro_rules! unimpl {
2
2
( ) => {
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
+ ) ) ;
4
7
} ;
5
8
}
6
9
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
148
148
libc:: EINVAL => ErrorKind :: InvalidInput ,
149
149
libc:: ETIMEDOUT => ErrorKind :: TimedOut ,
150
150
libc:: EEXIST => ErrorKind :: AlreadyExists ,
151
- libc:: ENOSYS => ErrorKind :: NotSupported ,
151
+ libc:: ENOSYS => ErrorKind :: Unsupported ,
152
152
153
153
// These two constants can have the same value on some systems,
154
154
// 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> {
447
447
#[ cfg( any( target_os = "fuchsia" , target_os = "l4re" ) ) ]
448
448
pub fn current_exe ( ) -> io:: Result < PathBuf > {
449
449
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!" ) )
451
451
}
452
452
453
453
#[ 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> {
18
18
}
19
19
20
20
pub 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
+ )
22
25
}
23
26
24
27
pub 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>> {
80
80
}
81
81
82
82
pub 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" ) )
84
84
}
85
85
86
86
pub 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" ) )
88
88
}
89
89
90
90
pub 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 {
83
83
libc:: EINVAL => ErrorKind :: InvalidInput ,
84
84
libc:: ETIMEDOUT => ErrorKind :: TimedOut ,
85
85
libc:: EEXIST => ErrorKind :: AlreadyExists ,
86
- libc:: ENOSYS => ErrorKind :: NotSupported ,
86
+ libc:: ENOSYS => ErrorKind :: Unsupported ,
87
87
88
88
// These two constants can have the same value on some systems,
89
89
// but different values on others, so we can't use a match
You can’t perform that action at this time.
0 commit comments