Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[wasm_bindgen] macro triggers clippy::extra_unused_type_parameters lint on nightly 1.69 #3326

Closed
obi1kenobi opened this issue Feb 21, 2023 · 2 comments
Labels

Comments

@obi1kenobi
Copy link

obi1kenobi commented Feb 21, 2023

Describe the Bug

#[wasm_bindgen] triggers a clippy lint newly added in 1.69 nightly: rust-lang/rust-clippy#10028

It seems benign and cosmetic, and hopefully should be an easy fix or an easy suppression.

Steps to Reproduce

Repository: https://github.com/obi1kenobi/trustfall
Commit: 4a68149f1d6d4cfdf6422b6c6fdd47c884a3e6bb
File: trustfall_wasm/src/shim.rs

Relevant snippet where the lint happens:

#[wasm_bindgen]
#[derive(Debug, Clone)]
pub struct JsContext {
    #[wasm_bindgen(js_name = "localId")]
    pub local_id: u32,
    active_vertex: Option<JsValue>,
}

This happens on wasm_bindgen v0.2.84 as well. You can see that on the wasm_update_for_deprecations branch in that repo; I haven't merged that branch yet because it also seems to be suffering from some other more severe regression in the WASM.

Expected Behavior

No lints when applying #[wasm_bindgen].

Actual Behavior

Running cargo clippy on nightly Rust 1.69 (clippy 0.1.69 (5243ea5 2023-02-20)) produces:

warning: type parameter goes unused in function definition
  --> trustfall_wasm/src/shim.rs:93:1
   |
93 | #[wasm_bindgen]
   | ^^^^^^^^^^^^^^^
   |
   = help: consider removing the parameter
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
   = note: `#[warn(clippy::extra_unused_type_parameters)]` on by default
   = note: this warning originates in the attribute macro `wasm_bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: `trustfall_wasm` (lib) generated 1 warning

Additional Context

N/A

@obi1kenobi obi1kenobi added the bug label Feb 21, 2023
@mkrasnitski
Copy link

This is false-positive in clippy and has been fixed in nightly 2023-02-26.

@obi1kenobi
Copy link
Author

Confirmed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants