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/tests/helper.rs:9:23
   |
9  |             fn _assert<T: Send + Sync + Unpin + std::panic::UnwindSafe>() {}
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: src/tests/mod.rs:27:1
   |
27 | test_atomic_bool_pub!();
   | ----------------------- in this macro invocation
   |
   = 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 macro `__test_atomic_common` which comes from the expansion of the macro `test_atomic_bool_pub` (in Nightly builds, run with -Z macro-backtrace for more info)
```
  • Loading branch information
taiki-e committed Feb 11, 2023
1 parent e12b4bd commit e5b567e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tests/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use core::{ops, sync::atomic::Ordering};

macro_rules! __test_atomic_common {
($atomic_type:ty, $value_type:ty) => {
#[allow(clippy::extra_unused_type_parameters)] // https://github.com/rust-lang/rust-clippy/issues/10319
#[test]
fn assert_auto_traits() {
fn _assert<T: Send + Sync + Unpin + std::panic::UnwindSafe>() {}
Expand All @@ -29,6 +30,7 @@ macro_rules! __test_atomic_common {
}
macro_rules! __test_atomic_pub_common {
($atomic_type:ty, $value_type:ty) => {
#[allow(clippy::extra_unused_type_parameters)] // https://github.com/rust-lang/rust-clippy/issues/10318
#[test]
fn assert_ref_unwind_safe() {
#[cfg(not(all(portable_atomic_no_core_unwind_safe, not(feature = "std"))))]
Expand Down
1 change: 1 addition & 0 deletions tools/codegen/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,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(())
}

0 comments on commit e5b567e

Please sign in to comment.