| 1 |
//! This is a test that we can define items in a `#![no_std]` crate when |
| 2 |
//! `wasm-bindgen` is compiled itself with the `std` feature and everything |
| 3 |
//! works out just fine. |
| 4 |
|
| 5 |
#![no_std] |
| 6 |
|
| 7 |
extern crate wasm_bindgen; |
| 8 |
|
| 9 |
use wasm_bindgen::prelude::*; |
| 10 |
|
| 11 |
#[wasm_bindgen] |
| 12 |
extern "C" { |
| 13 |
fn test(a: &str); |
| 14 |
|
| 15 |
type Js; |
| 16 |
#[wasm_bindgen(constructor)] |
| 17 |
fn new() -> Js; |
| 18 |
#[wasm_bindgen(method, structural)] |
| 19 |
fn init(this: &Js); |
| 20 |
} |
| 21 |
|
| 22 |
#[wasm_bindgen] |
| 23 |
pub struct A {} |
| 24 |
|
| 25 |
#[wasm_bindgen] |
| 26 |
impl A { |
| 27 |
pub fn foo(&self) {} |
| 28 |
pub fn bar(&mut self) {} |
| 29 |
} |