Add a test that fails to compile if generated code triggers unused lint warning. (#2145)

* Add a test that fails to compile if generated code triggers unused lint warning.

* Fix formatting.
This commit is contained in:
Tanner Rogalsky 2020-05-19 10:43:44 -04:00 committed by GitHub
parent 047b4209ad
commit 1e1cab6202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
tests/must_use.rs Normal file
View File

@ -0,0 +1,10 @@
//! This test validates that the generated bindings don't cause linting warnings
//! when used with structs annotated with `#[must_use]`.
#![deny(unused)]
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[must_use]
pub struct MustUse {}