Skip to content

Commit

Permalink
chore: fix CI test/clippy break with recent rust version
Browse files Browse the repository at this point in the history
  • Loading branch information
audunhalland committed Oct 30, 2024
1 parent 976b6ab commit ca438a3
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions entrait_macros/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions entrait_macros/src/entrait_impl/input_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl Parse for EntraitSimpleImplAttr {
}
}

#[expect(unused)]
pub struct EntraitImplAttr {
pub opts: Opts,
pub crate_idents: CrateIdents,
Expand Down
1 change: 1 addition & 0 deletions entrait_macros/src/entrait_trait/input_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions entrait_macros/src/entrait_trait/out_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use syn::spanned::Spanned;
pub struct OutTrait {
pub attrs: Vec<syn::Attribute>,
pub vis: syn::Visibility,
#[expect(unused)]
pub trait_token: syn::token::Trait,
pub generics: TraitGenerics,
pub ident: syn::Ident,
Expand Down
1 change: 1 addition & 0 deletions entrait_macros/src/fn_delegation_codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions entrait_macros/src/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ pub enum TraitIndirection {
DynamicImpl,
}

#[derive(Clone, Copy)]
pub struct UseAssociatedFuture(pub bool);

#[derive(Clone, Copy)]
pub struct TakesSelfByValue(pub bool);

Expand Down
4 changes: 4 additions & 0 deletions entrait_macros/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use syn::{
spanned::Spanned,
};

#[expect(unused)]
pub enum FnInputMode<'a> {
SingleFn(&'a syn::Ident),
Module(&'a syn::Ident),
Expand Down Expand Up @@ -159,6 +160,7 @@ impl ToTokens for ModItem {
}
}

#[expect(unused)]
pub struct DeriveImplTraitPath(pub syn::Path);

/// An impl block
Expand All @@ -168,8 +170,10 @@ pub struct InputImpl {
pub unsafety: Option<syn::token::Unsafe>,
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<ImplItem>,
}
Expand Down
2 changes: 2 additions & 0 deletions entrait_macros/src/signature/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 2 additions & 7 deletions entrait_macros/src/signature/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub enum ImplReceiverKind {
#[derive(Clone)]
pub struct EntraitSignature {
pub sig: syn::Signature,
#[expect(unused)]
pub et_lifetimes: Vec<EntraitLifetime>,
}

Expand All @@ -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,
}

Expand Down
4 changes: 2 additions & 2 deletions examples/async-graphql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions examples/axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions tests/it/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down

0 comments on commit ca438a3

Please sign in to comment.