Skip to content

Commit 33ea556

Browse files
committed
Categorize WASI as an "OS" rather than as an "environment".
This distinction is fairly abstract, but in practice, the main advantage here is that LLVM's triple code considers WASI to be an OS, so this makes rustc agree with that.
1 parent e232636 commit 33ea556

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc_target/spec/wasm32_unknown_wasi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ pub fn target() -> Result<Target, String> {
102102
target_endian: "little".to_string(),
103103
target_pointer_width: "32".to_string(),
104104
target_c_int_width: "32".to_string(),
105-
target_os: "unknown".to_string(),
106-
target_env: "wasi".to_string(),
105+
target_os: "wasi".to_string(),
106+
target_env: String::new(),
107107
target_vendor: "unknown".to_string(),
108108
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
109109
arch: "wasm32".to_string(),

src/libstd/os/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ cfg_if! {
5151
#[cfg(target_os = "emscripten")] pub mod emscripten;
5252
#[cfg(target_os = "fuchsia")] pub mod fuchsia;
5353
#[cfg(target_os = "hermit")] pub mod hermit;
54-
#[cfg(target_env = "wasi")] pub mod wasi;
54+
#[cfg(target_os = "wasi")] pub mod wasi;
5555
#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] pub mod fortanix_sgx;
5656

5757
pub mod raw;

src/libstd/sys/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cfg_if! {
3535
} else if #[cfg(target_os = "redox")] {
3636
mod redox;
3737
pub use self::redox::*;
38-
} else if #[cfg(target_env = "wasi")] {
38+
} else if #[cfg(target_os = "wasi")] {
3939
mod wasi;
4040
pub use self::wasi::*;
4141
} else if #[cfg(target_arch = "wasm32")] {

0 commit comments

Comments
 (0)