This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +11
-6
lines changed Expand file tree Collapse file tree 6 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,10 @@ pub enum ErrorKind {
180180 /// read.
181181 #[ stable( feature = "read_exact" , since = "1.6.0" ) ]
182182 UnexpectedEof ,
183+
184+ /// This operation is not supported on this platform.
185+ #[ stable( feature = "not_supported_error" , since = "1.50.0" ) ]
186+ NotSupported ,
183187}
184188
185189impl ErrorKind {
@@ -203,6 +207,7 @@ impl ErrorKind {
203207 ErrorKind :: Interrupted => "operation interrupted" ,
204208 ErrorKind :: Other => "other os error" ,
205209 ErrorKind :: UnexpectedEof => "unexpected end of file" ,
210+ ErrorKind :: NotSupported => "not supported" ,
206211 }
207212 }
208213}
Original file line number Diff line number Diff line change 11macro_rules! unimpl {
22 ( ) => {
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." ) ) ;
44 } ;
55}
66
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ 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 :: Other , & "operation not supported on this platform" )
21+ std_io:: Error :: new_const ( std_io:: ErrorKind :: NotSupported , & "operation not supported on this platform" )
2222}
2323
2424pub 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 :: Other , & "cannot set env vars on this platform" ) )
83+ Err ( io:: Error :: new_const ( io:: ErrorKind :: NotSupported , & "cannot set env vars on this platform" ) )
8484}
8585
8686pub 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" ) )
8888}
8989
9090pub 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<()> {
802802
803803#[ cfg( target_vendor = "uwp" ) ]
804804pub 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" ) ) ;
806806}
807807
808808pub fn stat ( path : & Path ) -> io:: Result < FileAttr > {
Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ impl Socket {
370370
371371 #[ cfg( target_vendor = "uwp" ) ]
372372 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" ) )
374374 }
375375
376376 pub fn shutdown ( & self , how : Shutdown ) -> io:: Result < ( ) > {
You can’t perform that action at this time.
0 commit comments