Skip to content

Commit 148a18e

Browse files
authored
Merge pull request #146 from dtolnay/complexity
Suppress type_complexity lint in generated code
2 parents ca91108 + f40ff9a commit 148a18e

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/expand.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ pub fn expand(input: &mut Item, is_local: bool) {
112112
fn lint_suppress_with_body() -> Attribute {
113113
parse_quote! {
114114
#[allow(
115+
clippy::type_complexity,
115116
clippy::type_repetition_in_bounds,
116117
clippy::used_underscore_binding
117118
)]
@@ -120,7 +121,10 @@ fn lint_suppress_with_body() -> Attribute {
120121

121122
fn lint_suppress_without_body() -> Attribute {
122123
parse_quote! {
123-
#[allow(clippy::type_repetition_in_bounds)]
124+
#[allow(
125+
clippy::type_complexity,
126+
clippy::type_repetition_in_bounds
127+
)]
124128
}
125129
}
126130

tests/test.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,3 +1218,18 @@ pub mod drop_order {
12181218
assert!(!flag.load(Ordering::Acquire));
12191219
}
12201220
}
1221+
1222+
// https://github.com/dtolnay/async-trait/issues/145
1223+
pub mod issue145 {
1224+
#![deny(clippy::type_complexity)]
1225+
1226+
use async_trait::async_trait;
1227+
1228+
#[async_trait]
1229+
pub trait ManageConnection: Sized + Send + Sync + 'static {
1230+
type Connection: Send + 'static;
1231+
type Error: Send + 'static;
1232+
1233+
async fn connect(&self) -> Result<Self::Connection, Self::Error>;
1234+
}
1235+
}

0 commit comments

Comments
 (0)