@@ -280,20 +280,22 @@ unfortunate accident which got relied on. The `wasm-bindgen` project prior to
280
280
seen as not worth the tradeoff of breaking ` wasm-bindgen ` historically to fix
281
281
this issue in the compiler.
282
282
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
285
286
[ #117919 ] ( https://github.com/rust-lang/rust/pull/117919 ) . This nightly-only flag
286
287
can be used to indicate whether the spec-defined version of ` extern "C" ` should
287
288
be used instead of the "legacy" version of
288
289
whatever-the-Rust-target-originally-implemented. For example using the above
289
290
code you can see (lightly edited for clarity):
290
291
291
- ```
292
+ ``` shell
292
293
$ rustc +nightly -Zwasm-c-abi=spec foo.rs --target wasm32-unknown-unknown --crate-type lib --emit obj -O
293
294
$ wasm-tools print foo.o
294
295
(module
295
296
(import " env" " take_my_pair" (func $take_my_pair (param i32) (result i32)))
296
297
(func $call_c (result i32)
298
+ ;; ...
297
299
)
298
300
;; ...
299
301
)
@@ -305,6 +307,8 @@ they should.
305
307
The ` -Zwasm-c-abi ` compiler flag is tracked in
306
308
[ #122532 ] ( https://github.com/rust-lang/rust/issues/122532 ) and a lint was
307
309
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