Skip to content

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

Closed
@obi1kenobi

Description

@obi1kenobi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions