Skip to content

Commit 1e1cab6

Browse files
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.
1 parent 047b420 commit 1e1cab6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/must_use.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//! This test validates that the generated bindings don't cause linting warnings
2+
//! when used with structs annotated with `#[must_use]`.
3+
4+
#![deny(unused)]
5+
6+
use wasm_bindgen::prelude::*;
7+
8+
#[wasm_bindgen]
9+
#[must_use]
10+
pub struct MustUse {}

0 commit comments

Comments
 (0)