1
+ use super :: { unsupported, Void } ;
1
2
use crate :: error:: Error as StdError ;
2
3
use crate :: ffi:: { OsStr , OsString } ;
3
4
use crate :: fmt;
4
5
use crate :: io;
5
6
use crate :: path:: { self , PathBuf } ;
6
- use crate :: str;
7
- use crate :: sys:: { unsupported, Void } ;
8
7
9
8
pub fn errno ( ) -> i32 {
10
9
0
@@ -48,14 +47,14 @@ where
48
47
49
48
impl fmt:: Display for JoinPathsError {
50
49
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
51
- "not supported on wasm yet" . fmt ( f)
50
+ "not supported on this platform yet" . fmt ( f)
52
51
}
53
52
}
54
53
55
54
impl StdError for JoinPathsError {
56
55
#[ allow( deprecated) ]
57
56
fn description ( & self ) -> & str {
58
- "not supported on wasm yet"
57
+ "not supported on this platform yet"
59
58
}
60
59
}
61
60
@@ -73,35 +72,33 @@ impl Iterator for Env {
73
72
}
74
73
75
74
pub fn env ( ) -> Env {
76
- panic ! ( "not supported on web assembly " )
75
+ panic ! ( "not supported on this platform " )
77
76
}
78
77
79
78
pub fn getenv ( _: & OsStr ) -> io:: Result < Option < OsString > > {
80
79
Ok ( None )
81
80
}
82
81
83
82
pub fn setenv ( _: & OsStr , _: & OsStr ) -> io:: Result < ( ) > {
84
- Err ( io:: Error :: new ( io:: ErrorKind :: Other , "cannot set env vars on wasm32-unknown-unknown " ) )
83
+ Err ( io:: Error :: new ( io:: ErrorKind :: Other , "cannot set env vars on this platform " ) )
85
84
}
86
85
87
86
pub fn unsetenv ( _: & OsStr ) -> io:: Result < ( ) > {
88
- Err ( io:: Error :: new ( io:: ErrorKind :: Other , "cannot unset env vars on wasm32-unknown-unknown " ) )
87
+ Err ( io:: Error :: new ( io:: ErrorKind :: Other , "cannot unset env vars on this platform " ) )
89
88
}
90
89
91
90
pub fn temp_dir ( ) -> PathBuf {
92
- panic ! ( "no filesystem on wasm " )
91
+ panic ! ( "no filesystem on this platform " )
93
92
}
94
93
95
94
pub fn home_dir ( ) -> Option < PathBuf > {
96
95
None
97
96
}
98
97
99
98
pub fn exit ( _code : i32 ) -> ! {
100
- unsafe {
101
- crate :: arch:: wasm32:: unreachable ( ) ;
102
- }
99
+ crate :: intrinsics:: abort ( )
103
100
}
104
101
105
102
pub fn getpid ( ) -> u32 {
106
- panic ! ( "no pids on wasm " )
103
+ panic ! ( "no pids on this platform " )
107
104
}
0 commit comments