.cargo/vendor/wasm-bindgen/tests/wasm/macro_rules.rs
raw| 1 | //! This tests that the `wasm_bindgen` macro produces code that compiles for this use case. |
| 2 | //! `cargo test --target wasm32-unknown-unknown` will not run if this test breaks. |
| 3 | use wasm_bindgen::prelude::*; |
| 4 | |
| 5 | macro_rules! my_export { |
| 6 | ($i: ident, $s: ty) => { |
| 7 | #[wasm_bindgen] |
| 8 | pub fn $i(_: $s) {} |
| 9 | }; |
| 10 | } |
| 11 | |
| 12 | my_export!(should_compile, &[i32]); |