Skip to content

Commit ca61d74

Browse files
authored
Rollup merge of #126662 - alexcrichton:warn-on-wasm32-wasi, r=michaelwoerister
Unconditionally warn on usage of `wasm32-wasi` This commit is a continuation of the work originally proposed in rust-lang/compiler-team#607 and later amended in rust-lang/compiler-team#695. The end goal is to rename `wasm32-wasi` to `wasm32-wasip1` to reflect WASI's development and distinguish the preexisting target from the `wasm32-wasip2` target that WASI is now developing. Work for this transition began in #120468 which landed in Rust 1.78 which became stable on 2024-05-02. This implements the next phase of the transition plan to warn on usage of `wasm32-wasi`. This is intended to help alert users that a removal is pending and all release channels have the replacement available as well. This will reach stable on 2024-09-05. The next stage of the plan is to remove the `wasm32-wasi` target some time in October 2024 which means that the removal will reach stable on 2025-01-09. For reference a full schedule of this transition is listed [here]. Currently this implementation is a simple unconditional warning whenever `rustc --target wasm32-wasi` is invoked. As-implemented there's no way to turn off the warning other than to switch to the `wasm32-wasip1` target. [here]: #120468 (comment)
2 parents cbf9d57 + e003a12 commit ca61d74

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

compiler/rustc_session/src/config.rs

+14
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,20 @@ pub fn build_target_config(early_dcx: &EarlyDiagCtxt, opts: &Options, sysroot: &
13111311
for warning in warnings.warning_messages() {
13121312
early_dcx.early_warn(warning)
13131313
}
1314+
1315+
// The `wasm32-wasi` target is being renamed to `wasm32-wasip1` as
1316+
// part of rust-lang/compiler-team#607 and
1317+
// rust-lang/compiler-team#695. Warn unconditionally on usage to
1318+
// raise awareness of the renaming. This code will be deleted in
1319+
// October 2024.
1320+
if opts.target_triple.triple() == "wasm32-wasi" {
1321+
early_dcx.early_warn(
1322+
"the `wasm32-wasi` target is being renamed to \
1323+
`wasm32-wasip1` and the `wasm32-wasi` target will be \
1324+
removed from nightly in October 2024 and removed from \
1325+
stable Rust in January 2025",
1326+
)
1327+
}
13141328
if !matches!(target.pointer_width, 16 | 32 | 64) {
13151329
early_dcx.early_fatal(format!(
13161330
"target specification was invalid: unrecognized target-pointer-width {}",

0 commit comments

Comments
 (0)