From 5629db96780496e7a99b7e978dbbe164f867c6b8 Mon Sep 17 00:00:00 2001 From: Caio Date: Thu, 9 Dec 2021 07:57:05 -0300 Subject: [PATCH 1/3] Fix `clippy::shadow_same` warning --- src/expand.rs | 3 ++- tests/test.rs | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/expand.rs b/src/expand.rs index 8ce395f..3e25b2b 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -128,7 +128,8 @@ fn lint_suppress_with_body() -> Attribute { clippy::no_effect_underscore_binding, clippy::type_complexity, clippy::type_repetition_in_bounds, - clippy::used_underscore_binding + clippy::used_underscore_binding, + clippy::shadow_same )] } } diff --git a/tests/test.rs b/tests/test.rs index ac764b7..36d0267 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1377,3 +1377,13 @@ pub mod issue169 { pub fn test(_t: &dyn Trait) {} } + +// https://github.com/dtolnay/async-trait/issues/183 +pub mod issue183 { + #![deny(clippy::shadow_same)] + + #[async_trait::async_trait] + trait Foo { + async fn foo(_n: i32) {} + } +} \ No newline at end of file From 572f7e95f41f5b49b6153c690461753be82bab1c Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 9 Dec 2021 04:24:21 -0800 Subject: [PATCH 2/3] Sort lint_suppress_with_body --- src/expand.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/expand.rs b/src/expand.rs index 3e25b2b..2f4697a 100644 --- a/src/expand.rs +++ b/src/expand.rs @@ -126,10 +126,10 @@ fn lint_suppress_with_body() -> Attribute { #[allow( clippy::let_unit_value, clippy::no_effect_underscore_binding, + clippy::shadow_same, clippy::type_complexity, clippy::type_repetition_in_bounds, - clippy::used_underscore_binding, - clippy::shadow_same + clippy::used_underscore_binding )] } } From 7f0d4b6488fd482e68ab5185e86275ed8feac465 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 9 Dec 2021 04:24:33 -0800 Subject: [PATCH 3/3] Format PR 184 with rustfmt --- tests/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.rs b/tests/test.rs index 36d0267..a19dcbe 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1386,4 +1386,4 @@ pub mod issue183 { trait Foo { async fn foo(_n: i32) {} } -} \ No newline at end of file +}