From ca438a3c726f306056449a14e7b2aa8f9d20256e Mon Sep 17 00:00:00 2001 From: Audun Halland Date: Wed, 30 Oct 2024 23:48:15 +0100 Subject: [PATCH] chore: fix CI test/clippy break with recent rust version --- entrait_macros/src/attributes.rs | 1 + entrait_macros/src/entrait_impl/input_attr.rs | 1 + entrait_macros/src/entrait_trait/input_attr.rs | 1 + entrait_macros/src/entrait_trait/out_trait.rs | 1 + entrait_macros/src/fn_delegation_codegen.rs | 1 + entrait_macros/src/generics.rs | 3 --- entrait_macros/src/input.rs | 4 ++++ entrait_macros/src/signature/converter.rs | 2 ++ entrait_macros/src/signature/mod.rs | 9 ++------- examples/async-graphql/Cargo.toml | 4 ++-- examples/axum/Cargo.toml | 4 ++-- tests/it/simple.rs | 1 + 12 files changed, 18 insertions(+), 14 deletions(-) diff --git a/entrait_macros/src/attributes.rs b/entrait_macros/src/attributes.rs index 0949073..3b077cd 100644 --- a/entrait_macros/src/attributes.rs +++ b/entrait_macros/src/attributes.rs @@ -84,6 +84,7 @@ impl<'a> ToTokens for EntraitForTraitParams<'a> { } pub struct UnimockAttrParams<'s> { + #[expect(unused)] pub trait_ident: &'s syn::Ident, pub mock_api: Option<&'s MockApiIdent>, pub trait_indirection: TraitIndirection, diff --git a/entrait_macros/src/entrait_impl/input_attr.rs b/entrait_macros/src/entrait_impl/input_attr.rs index 0d248a8..5bf0d1f 100644 --- a/entrait_macros/src/entrait_impl/input_attr.rs +++ b/entrait_macros/src/entrait_impl/input_attr.rs @@ -63,6 +63,7 @@ impl Parse for EntraitSimpleImplAttr { } } +#[expect(unused)] pub struct EntraitImplAttr { pub opts: Opts, pub crate_idents: CrateIdents, diff --git a/entrait_macros/src/entrait_trait/input_attr.rs b/entrait_macros/src/entrait_trait/input_attr.rs index a8fc0f2..1eae14b 100644 --- a/entrait_macros/src/entrait_trait/input_attr.rs +++ b/entrait_macros/src/entrait_trait/input_attr.rs @@ -10,6 +10,7 @@ pub struct EntraitTraitAttr { pub crate_idents: CrateIdents, } +#[expect(unused)] pub struct ImplTrait(pub syn::Visibility, pub syn::Ident); impl Parse for EntraitTraitAttr { diff --git a/entrait_macros/src/entrait_trait/out_trait.rs b/entrait_macros/src/entrait_trait/out_trait.rs index ba0d98a..e3a3415 100644 --- a/entrait_macros/src/entrait_trait/out_trait.rs +++ b/entrait_macros/src/entrait_trait/out_trait.rs @@ -11,6 +11,7 @@ use syn::spanned::Spanned; pub struct OutTrait { pub attrs: Vec, pub vis: syn::Visibility, + #[expect(unused)] pub trait_token: syn::token::Trait, pub generics: TraitGenerics, pub ident: syn::Ident, diff --git a/entrait_macros/src/fn_delegation_codegen.rs b/entrait_macros/src/fn_delegation_codegen.rs index 5f9fba3..6a25779 100644 --- a/entrait_macros/src/fn_delegation_codegen.rs +++ b/entrait_macros/src/fn_delegation_codegen.rs @@ -19,6 +19,7 @@ use crate::token_util::TokenPair; /// Generate impls that call standalone generic functions pub struct FnDelegationCodegen<'s, TR> { pub opts: &'s Opts, + #[expect(unused)] pub crate_idents: &'s CrateIdents, pub trait_ref: &'s TR, pub trait_span: Span, diff --git a/entrait_macros/src/generics.rs b/entrait_macros/src/generics.rs index 63033ce..25a38dc 100644 --- a/entrait_macros/src/generics.rs +++ b/entrait_macros/src/generics.rs @@ -25,9 +25,6 @@ pub enum TraitIndirection { DynamicImpl, } -#[derive(Clone, Copy)] -pub struct UseAssociatedFuture(pub bool); - #[derive(Clone, Copy)] pub struct TakesSelfByValue(pub bool); diff --git a/entrait_macros/src/input.rs b/entrait_macros/src/input.rs index f1e0074..404b885 100644 --- a/entrait_macros/src/input.rs +++ b/entrait_macros/src/input.rs @@ -13,6 +13,7 @@ use syn::{ spanned::Spanned, }; +#[expect(unused)] pub enum FnInputMode<'a> { SingleFn(&'a syn::Ident), Module(&'a syn::Ident), @@ -159,6 +160,7 @@ impl ToTokens for ModItem { } } +#[expect(unused)] pub struct DeriveImplTraitPath(pub syn::Path); /// An impl block @@ -168,8 +170,10 @@ pub struct InputImpl { pub unsafety: Option, pub impl_token: syn::token::Impl, pub trait_path: syn::Path, + #[expect(unused)] pub for_token: syn::token::For, pub self_ty: syn::Type, + #[expect(unused)] pub brace_token: syn::token::Brace, pub items: Vec, } diff --git a/entrait_macros/src/signature/converter.rs b/entrait_macros/src/signature/converter.rs index 5a82fb8..2faef77 100644 --- a/entrait_macros/src/signature/converter.rs +++ b/entrait_macros/src/signature/converter.rs @@ -7,7 +7,9 @@ use syn::spanned::Spanned; pub struct SignatureConverter<'a> { pub crate_idents: &'a CrateIdents, + #[expect(unused)] pub trait_span: Span, + #[expect(unused)] pub opts: &'a Opts, pub input_sig: InputSig<'a>, pub deps: &'a FnDeps, diff --git a/entrait_macros/src/signature/mod.rs b/entrait_macros/src/signature/mod.rs index a4a1036..617bdfa 100644 --- a/entrait_macros/src/signature/mod.rs +++ b/entrait_macros/src/signature/mod.rs @@ -36,6 +36,7 @@ pub enum ImplReceiverKind { #[derive(Clone)] pub struct EntraitSignature { pub sig: syn::Signature, + #[expect(unused)] pub et_lifetimes: Vec, } @@ -48,16 +49,10 @@ impl EntraitSignature { } } -#[derive(Clone)] -pub struct AssociatedFut { - pub ident: syn::Ident, - pub output: syn::Type, - pub base_lifetime: syn::Lifetime, -} - /// Only used for associated future: #[derive(Clone)] pub struct EntraitLifetime { + #[expect(unused)] pub lifetime: syn::Lifetime, } diff --git a/examples/async-graphql/Cargo.toml b/examples/async-graphql/Cargo.toml index 392ae10..c869845 100644 --- a/examples/async-graphql/Cargo.toml +++ b/examples/async-graphql/Cargo.toml @@ -12,8 +12,8 @@ async-trait = "0.1" implementation = "0.1" [dev-dependencies] -tower = "0.4" -tower-http = { version = "0.5", features = ["trace"] } +tower = "0.5" +tower-http = { version = "0.6", features = ["trace"] } hyper = { version = "1", features = ["full"] } serde_json = "1" unimock = "0.6.2" diff --git a/examples/axum/Cargo.toml b/examples/axum/Cargo.toml index bc6977e..1614d49 100644 --- a/examples/axum/Cargo.toml +++ b/examples/axum/Cargo.toml @@ -13,8 +13,8 @@ implementation = "0.1" async-trait = "0.1" [dev-dependencies] -tower = "0.4" -tower-http = { version = "0.5", features = ["trace"] } +tower = "0.5" +tower-http = { version = "0.6", features = ["trace"] } hyper = { version = "1", features = ["full"] } serde_json = "1" unimock = "0.6.2" diff --git a/tests/it/simple.rs b/tests/it/simple.rs index 3c0a186..033adb7 100644 --- a/tests/it/simple.rs +++ b/tests/it/simple.rs @@ -229,6 +229,7 @@ mod module { // The macro cannot just append a another `::super`, because `pub(super::super)` is invalid syntax. } +#[expect(unexpected_cfgs)] mod cfg_attributes { use entrait::*;