Skip to content

Commit 5e5156b

Browse files
committed
Updates/clarifications
1 parent 992b0b3 commit 5e5156b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/doc/rustc/src/platform-support/wasm32-unknown-unknown.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -280,20 +280,22 @@ unfortunate accident which got relied on. The `wasm-bindgen` project prior to
280280
seen as not worth the tradeoff of breaking `wasm-bindgen` historically to fix
281281
this issue in the compiler.
282282

283-
Thanks to the heroic efforts of many involved in this, however, the nightly
284-
compiler currently supports a `-Zwasm-c-abi` implemented in
283+
Thanks to the heroic efforts of many involved in this, however, `wasm-bindgen`
284+
0.2.89 and later are compatible with the correct definition of `extern "C"` and
285+
the nightly compiler currently supports a `-Zwasm-c-abi` implemented in
285286
[#117919](https://github.com/rust-lang/rust/pull/117919). This nightly-only flag
286287
can be used to indicate whether the spec-defined version of `extern "C"` should
287288
be used instead of the "legacy" version of
288289
whatever-the-Rust-target-originally-implemented. For example using the above
289290
code you can see (lightly edited for clarity):
290291

291-
```
292+
```shell
292293
$ rustc +nightly -Zwasm-c-abi=spec foo.rs --target wasm32-unknown-unknown --crate-type lib --emit obj -O
293294
$ wasm-tools print foo.o
294295
(module
295296
(import "env" "take_my_pair" (func $take_my_pair (param i32) (result i32)))
296297
(func $call_c (result i32)
298+
;; ...
297299
)
298300
;; ...
299301
)
@@ -305,6 +307,8 @@ they should.
305307
The `-Zwasm-c-abi` compiler flag is tracked in
306308
[#122532](https://github.com/rust-lang/rust/issues/122532) and a lint was
307309
implemented in [#117918](https://github.com/rust-lang/rust/issues/117918) to
308-
help warn users about the transition. The current plan is to, in the future,
309-
switch `-Zwasm-c-api=spec` to being the default. Some time after that the
310-
`-Zwasm-c-abi` flag and the "legacy" implementation will all be removed.
310+
help warn users about the transition if they're using `wasm-bindgen` 0.2.88 or
311+
prior. The current plan is to, in the future, switch `-Zwasm-c-api=spec` to
312+
being the default. Some time after that the `-Zwasm-c-abi` flag and the
313+
"legacy" implementation will all be removed. During this process users on a
314+
sufficiently updated version of `wasm-bindgen` should not experience breakage.

0 commit comments

Comments
 (0)