From 99783f0bc62ccb25efb7d2c9fa8d4d4a8380aae5 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 17 Jun 2020 11:34:49 -0700 Subject: [PATCH] Document wasm-bindgen incompatibility with C/C++ cc @RReverser @alexcrichton. I'm not sure if there would be a better or more prominent place to document this problem. --- guide/src/reference/rust-targets.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guide/src/reference/rust-targets.md b/guide/src/reference/rust-targets.md index fc7b797ba62..fb54a706cc1 100644 --- a/guide/src/reference/rust-targets.md +++ b/guide/src/reference/rust-targets.md @@ -70,3 +70,9 @@ The `wasm-bindgen` target does not support the `wasm32-unknown-emscripten` nor the `asmjs-unknown-emscripten` targets. There are currently no plans to support these targets either. All annotations work like other platforms on the targets, retaining exported functions and causing all imports to panic. + +However, note that only the `wasm32-unknown-emscripten` target supports linking +Rust and C or C++ together. There is currently no way to both use `wasm-bindgen` +and also safely link with C or C++. There is a general long-term plan to fix +this, but there is no immediate solution. See this +[issue](https://github.com/rustwasm/team/issues/291) for more context.