@@ -205,7 +205,7 @@ be fixed in a future version of Rust.
205205
206206For example this Rust code:
207207
208- ``` rust
208+ ``` rust,ignore (does-not-link)
209209#[repr(C)]
210210struct MyPair {
211211 a: u32,
@@ -280,20 +280,22 @@ unfortunate accident which got relied on. The `wasm-bindgen` project prior to
280280seen as not worth the tradeoff of breaking ` wasm-bindgen ` historically to fix
281281this 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
286287can be used to indicate whether the spec-defined version of ` extern "C" ` should
287288be used instead of the "legacy" version of
288289whatever-the-Rust-target-originally-implemented. For example using the above
289290code 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.
305307The ` -Zwasm-c-abi ` compiler flag is tracked in
306308[ #122532 ] ( https://github.com/rust-lang/rust/issues/122532 ) and a lint was
307309implemented 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