Open djc opened 2 weeks ago
Do you have the error too please?
Warnings:
warning: duplicated attribute
--> epoxide/src/graphql/message.rs:16:26
|
16 | arg(name = "before", ty = "Option<String>"),
| ^^^^^^^^^^^^^^^^^^^^^
|
note: first defined here
--> epoxide/src/graphql/message.rs:15:25
|
15 | arg(name = "after", ty = "Option<String>"),
| ^^^^^^^^^^^^^^^^^^^^^
help: remove this attribute
--> epoxide/src/graphql/message.rs:16:26
|
16 | arg(name = "before", ty = "Option<String>"),
| ^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
= note: `#[warn(clippy::duplicated_attributes)]` on by default
warning: duplicated attribute
--> epoxide/src/graphql/message.rs:18:24
|
18 | arg(name = "last", ty = "Option<i32>")
| ^^^^^^^^^^^^^^^^^^
|
note: first defined here
--> epoxide/src/graphql/message.rs:17:25
|
17 | arg(name = "first", ty = "Option<i32>"),
| ^^^^^^^^^^^^^^^^^^
help: remove this attribute
--> epoxide/src/graphql/message.rs:18:24
|
18 | arg(name = "last", ty = "Option<i32>")
| ^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
warning: `epoxide` (lib) generated 2 warnings
ambassador (0.3.7) seems to have a similar problem (see https://github.com/hobofan/ambassador/issues/57).
I've tried to make a more minimal example:
#![allow(unused)]
use ambassador::{delegatable_trait, Delegate};
#[delegatable_trait]
trait Trait1 {}
#[delegatable_trait]
trait Trait2 {}
#[derive(Delegate)]
#[delegate(Trait1, target = "0")]
#[delegate(Trait2, target = "0")]
struct S<X>(X);
fn main() {}
cargo expand
#![feature(prelude_import)]
#![allow(unused)]
#[prelude_import]
use std::prelude::rust_2021::*;
#[macro_use]
extern crate std;
use ambassador::{delegatable_trait, Delegate};
trait Trait1 {}
trait Trait2 {}
#[delegate(Trait1, target = "0")]
#[delegate(Trait2, target = "0")]
struct S<X>(X);
impl<X> Trait1 for S<X>
where
X: Trait1,
{}
impl<X> Trait2 for S<X>
where
X: Trait2,
{}
fn main() {}
cargo +nightly clippy
warning: duplicated attribute
--> src/main.rs:12:20
|
12 | #[delegate(Trait2, target = "0")]
| ^^^^^^^^^^^^
|
note: first defined here
--> src/main.rs:11:20
|
11 | #[delegate(Trait1, target = "0")]
| ^^^^^^^^^^^^
help: remove this attribute
--> src/main.rs:12:20
|
12 | #[delegate(Trait2, target = "0")]
| ^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
= note: `#[warn(clippy::duplicated_attributes)]` on by default
Would it be possible to not run the lint on derive macro helper attributes?
Summary
Don't have a stand-alone reproducible example yet, but I have this:
See also here: https://async-graphql.github.io/async-graphql/en/define_interface.html.
Expanded macro output
```rust #[allow(clippy::all, clippy::pedantic)] impl<'a> Sender<'a> { #[inline] pub async fn r#messages<'ctx>( &self, ctx: &'ctx async_graphql::Context<'ctx>, arg0: OptionLint Name
duplicated_attributes
Reproducer
No response
Version
cc @GuillaumeGomez (who seems to have created this lint)