Skip to content

Commit

Permalink
Categorize WASI as an "OS" rather than as an "environment".
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sunfishcode committed May 4, 2019
1 parent e232636 commit 33ea556
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/librustc_target/spec/wasm32_unknown_wasi.rs
Expand Up @@ -102,8 +102,8 @@ pub fn target() -> Result<Target, String> {
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
target_c_int_width: "32".to_string(),
target_os: "unknown".to_string(),
target_env: "wasi".to_string(),
target_os: "wasi".to_string(),
target_env: String::new(),
target_vendor: "unknown".to_string(),
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
arch: "wasm32".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/os/mod.rs
Expand Up @@ -51,7 +51,7 @@ cfg_if! {
#[cfg(target_os = "emscripten")] pub mod emscripten;
#[cfg(target_os = "fuchsia")] pub mod fuchsia;
#[cfg(target_os = "hermit")] pub mod hermit;
#[cfg(target_env = "wasi")] pub mod wasi;
#[cfg(target_os = "wasi")] pub mod wasi;
#[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] pub mod fortanix_sgx;

pub mod raw;
2 changes: 1 addition & 1 deletion src/libstd/sys/mod.rs
Expand Up @@ -35,7 +35,7 @@ cfg_if! {
} else if #[cfg(target_os = "redox")] {
mod redox;
pub use self::redox::*;
} else if #[cfg(target_env = "wasi")] {
} else if #[cfg(target_os = "wasi")] {
mod wasi;
pub use self::wasi::*;
} else if #[cfg(target_arch = "wasm32")] {
Expand Down

0 comments on commit 33ea556

Please sign in to comment.