diff options
Diffstat (limited to 'vendor/wasm-bindgen-macro/ui-tests/unused-attributes.rs')
-rw-r--r-- | vendor/wasm-bindgen-macro/ui-tests/unused-attributes.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/wasm-bindgen-macro/ui-tests/unused-attributes.rs b/vendor/wasm-bindgen-macro/ui-tests/unused-attributes.rs new file mode 100644 index 000000000..f517dcc4b --- /dev/null +++ b/vendor/wasm-bindgen-macro/ui-tests/unused-attributes.rs @@ -0,0 +1,32 @@ +#![deny(unused_variables)] + +use wasm_bindgen::prelude::*; + +struct A {} + +#[wasm_bindgen] +impl A { + #[wasm_bindgen(method)] + pub fn foo() {} +} + +#[wasm_bindgen] +pub struct MyStruct { + hello: String, +} + +#[wasm_bindgen(getter, typescript_custom_section)] +pub const FOO: &'static str = "FOO"; + +#[wasm_bindgen(readonly)] +pub fn bar() {} + +#[wasm_bindgen(getter_with_clone, final)] +impl MyStruct { + #[wasm_bindgen(getter, typescript_type = "Thing[]")] + pub fn hello(&self) -> String { + self.hello.clone() + } +} + +fn main() {} |