rustc_target/spec/targets/
wasm32_wasip3.rs

1//! The `wasm32-wasip3` target is the next in the chain of `wasm32-wasip1`, then
2//! `wasm32-wasip2`, then WASIp3. The main feature of WASIp3 is native async
3//! support in the component model itself.
4//!
5//! Like `wasm32-wasip2` this target produces a component by default. Support
6//! for `wasm32-wasip3` is very early as of the time of this writing so
7//! components produced will still import WASIp2 APIs, but that's ok since it's
8//! all component-model-level imports anyway. Over time the imports of the
9//! standard library will change to WASIp3.
10
11use crate::spec::Target;
12
13pub(crate) fn target() -> Target {
14    // As of now WASIp3 is a lightly edited wasip2 target, so start with that
15    // and this may grow over time as more features are supported.
16    let mut target = super::wasm32_wasip2::target();
17    target.llvm_target = "wasm32-wasip3".into();
18    target.options.env = "p3".into();
19    target
20}