File tree 6 files changed +11
-6
lines changed
6 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,10 @@ pub enum ErrorKind {
180
180
/// read.
181
181
#[ stable( feature = "read_exact" , since = "1.6.0" ) ]
182
182
UnexpectedEof ,
183
+
184
+ /// This operation is not supported on this platform.
185
+ #[ stable( feature = "not_supported_error" , since = "1.50.0" ) ]
186
+ NotSupported ,
183
187
}
184
188
185
189
impl ErrorKind {
@@ -203,6 +207,7 @@ impl ErrorKind {
203
207
ErrorKind :: Interrupted => "operation interrupted" ,
204
208
ErrorKind :: Other => "other os error" ,
205
209
ErrorKind :: UnexpectedEof => "unexpected end of file" ,
210
+ ErrorKind :: NotSupported => "not supported" ,
206
211
}
207
212
}
208
213
}
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 :: Other , & "No networking available on L4Re." ) ) ;
3
+ return Err ( io:: Error :: new_const( io:: ErrorKind :: NotSupported , & "No networking available on L4Re." ) ) ;
4
4
} ;
5
5
}
6
6
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ 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 :: Other , & "operation not supported on this platform" )
21
+ std_io:: Error :: new_const ( std_io:: ErrorKind :: NotSupported , & "operation not supported on this platform" )
22
22
}
23
23
24
24
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 :: Other , & "cannot set env vars on this platform" ) )
83
+ Err ( io:: Error :: new_const ( io:: ErrorKind :: NotSupported , & "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 :: Other , & "cannot unset env vars on this platform" ) )
87
+ Err ( io:: Error :: new_const ( io:: ErrorKind :: NotSupported , & "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 @@ -802,7 +802,7 @@ pub fn link(original: &Path, link: &Path) -> io::Result<()> {
802
802
803
803
#[ cfg( target_vendor = "uwp" ) ]
804
804
pub fn link ( _original : & Path , _link : & Path ) -> io:: Result < ( ) > {
805
- return Err ( io:: Error :: new_const ( io:: ErrorKind :: Other , & "hard link are not supported on UWP" ) ) ;
805
+ return Err ( io:: Error :: new_const ( io:: ErrorKind :: NotSupported , & "hard link are not supported on UWP" ) ) ;
806
806
}
807
807
808
808
pub fn stat ( path : & Path ) -> io:: Result < FileAttr > {
Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ impl Socket {
370
370
371
371
#[ cfg( target_vendor = "uwp" ) ]
372
372
fn set_no_inherit ( & self ) -> io:: Result < ( ) > {
373
- Err ( io:: Error :: new_const ( io:: ErrorKind :: Other , & "Unavailable on UWP" ) )
373
+ Err ( io:: Error :: new_const ( io:: ErrorKind :: NotSupported , & "Unavailable on UWP" ) )
374
374
}
375
375
376
376
pub fn shutdown ( & self , how : Shutdown ) -> io:: Result < ( ) > {
You can’t perform that action at this time.
0 commit comments