summaryrefslogtreecommitdiffstats
path: root/vendor/wasm-bindgen/tests/wasm/macro_rules.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/wasm-bindgen/tests/wasm/macro_rules.rs')
-rw-r--r--vendor/wasm-bindgen/tests/wasm/macro_rules.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/wasm-bindgen/tests/wasm/macro_rules.rs b/vendor/wasm-bindgen/tests/wasm/macro_rules.rs
new file mode 100644
index 000000000..42c4b2a1d
--- /dev/null
+++ b/vendor/wasm-bindgen/tests/wasm/macro_rules.rs
@@ -0,0 +1,12 @@
+//! This tests that the `wasm_bindgen` macro produces code that compiles for this use case.
+//! `cargo test --target wasm32-unknown-unknown` will not run if this test breaks.
+use wasm_bindgen::prelude::*;
+
+macro_rules! my_export {
+ ($i: ident, $s: ty) => {
+ #[wasm_bindgen]
+ pub fn $i(_: $s) {}
+ };
+}
+
+my_export!(should_compile, &[i32]);