Skip to content

Commit

Permalink
Ignore extra_unused_type_parameters clippy lint in generated code
Browse files Browse the repository at this point in the history
    error: type parameter goes unused in function definition
      --> demo/src/main.rs:11:14
       |
    11 |         type MultiBuf;
       |              ^^^^^^^^
       |
       = 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: `-D clippy::extra-unused-type-parameters` implied by `-D clippy::all`

    error: type parameter goes unused in function definition
      --> src/cxx_string.rs:94:15
       |
    94 |     pub fn new<T: Private>() -> Self {
       |               ^^^^^^^^^^^^
       |
       = help: consider removing the parameter
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

    error: type parameter goes unused in function definition
       --> src/extern_type.rs:184:27
        |
    184 | pub fn verify_extern_type<T: ExternType<Id = Id>, Id>() {}
        |                           ^^^^^^^^^^^^^^^^^^^^^^^
        |
        = 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: `-D clippy::extra-unused-type-parameters` implied by `-D clippy::all`

    error: type parameter goes unused in function definition
       --> src/extern_type.rs:187:27
        |
    187 | pub fn verify_extern_kind<T: ExternType<Kind = Kind>, Kind: self::Kind>() {}
        |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: consider removing the parameter
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

    error: type parameter goes unused in function definition
       --> tests/ffi/lib.rs:230:14
        |
    230 |         type Reference<'a>;
        |              ^^^^^^^^^
        |
        = 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: `-D clippy::extra-unused-type-parameters` implied by `-D clippy::all`

    error: type parameter goes unused in function definition
       --> tests/ffi/lib.rs:259:14
        |
    259 |         type R;
        |              ^
        |
        = help: consider removing the parameter
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
  • Loading branch information
dtolnay committed Feb 11, 2023
1 parent a2f3ccc commit b3bdffc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions macro/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ fn expand(ffi: Module, doc: Doc, attrs: OtherAttrs, apis: &[Api], types: &Types)
#[allow(
non_camel_case_types,
non_snake_case,
clippy::extra_unused_type_parameters,
clippy::ptr_as_ptr,
clippy::upper_case_acronyms,
clippy::use_self,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@
clippy::declare_interior_mutable_const,
clippy::doc_markdown,
clippy::empty_enum,
clippy::extra_unused_type_parameters,
clippy::inherent_to_string,
clippy::items_after_statements,
clippy::large_enum_variant,
Expand Down

0 comments on commit b3bdffc

Please sign in to comment.