Skip to content

Commit

Permalink
Ignore clippy::extra_unused_type_parameters lint in test
Browse files Browse the repository at this point in the history
```
warning: type parameter goes unused in function definition
 --> src/gen/assert_impl.rs:8:15
  |
8 | fn assert_send<T: ?Sized + Send>() {}
  |               ^^^^^^^^^^^^^^^^^^
  |
  = 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

warning: type parameter goes unused in function definition
  --> src/gen/assert_impl.rs:10:15
   |
10 | fn assert_sync<T: ?Sized + Sync>() {}
   |               ^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing the parameter
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

warning: type parameter goes unused in function definition
  --> src/gen/assert_impl.rs:12:16
   |
12 | fn assert_unpin<T: ?Sized + Unpin>() {}
   |                ^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing the parameter
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

warning: type parameter goes unused in function definition
  --> src/gen/assert_impl.rs:14:22
   |
14 | fn assert_unwind_safe<T: ?Sized + std::panic::UnwindSafe>() {}
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing the parameter
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters

warning: type parameter goes unused in function definition
  --> src/gen/assert_impl.rs:16:26
   |
16 | fn assert_ref_unwind_safe<T: ?Sized + std::panic::RefUnwindSafe>() {}
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = 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
taiki-e committed Feb 11, 2023
1 parent 09bbf78 commit 8ad4c8d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/gen/assert_impl.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tools/codegen/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,6 @@ pub fn write_raw(function_name: &str, path: &Path, contents: impl AsRef<[u8]>) -
return Ok(());
}
fs::write(path, out)?;
eprintln!("updated {}", p.display());
Ok(())
}
6 changes: 5 additions & 1 deletion tools/codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,11 @@ fn gen_assert_impl() -> Result<()> {
}

let mut out = quote! {
#![allow(clippy::std_instead_of_alloc, clippy::std_instead_of_core)]
#![allow(
clippy::extra_unused_type_parameters, // https://github.com/rust-lang/rust-clippy/issues/10319
clippy::std_instead_of_alloc,
clippy::std_instead_of_core,
)]
#[allow(dead_code)]
fn assert_send<T: ?Sized + Send>() {}
#[allow(dead_code)]
Expand Down

0 comments on commit 8ad4c8d

Please sign in to comment.