diff --git a/Cargo.lock b/Cargo.lock index 6c2fb03..193c71d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -455,7 +455,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] diff --git a/packages/fortifier-macros/Cargo.toml b/packages/fortifier-macros/Cargo.toml index 7e545dc..003eeb8 100644 --- a/packages/fortifier-macros/Cargo.toml +++ b/packages/fortifier-macros/Cargo.toml @@ -24,7 +24,7 @@ convert_case = "0.11.0" proc-macro-crate = "3.4.0" proc-macro2 = "1.0.103" quote = "1.0.42" -syn = "2.0.110" +syn = "3.0.0" [lints] workspace = true diff --git a/packages/fortifier-macros/src/generics.rs b/packages/fortifier-macros/src/generics.rs index 085d42f..9e5f464 100644 --- a/packages/fortifier-macros/src/generics.rs +++ b/packages/fortifier-macros/src/generics.rs @@ -176,7 +176,7 @@ fn const_param_matches_argument(_param: &ConstParam, argument: &GenericArgument) fn type_matches_ident(r#type: &Type, ident: &Ident) -> bool { match r#type { Type::Array(_) => false, - Type::BareFn(_) => false, + Type::FnPtr(_) => false, Type::Group(r#type) => type_matches_ident(&r#type.elem, ident), Type::ImplTrait(_) => false, Type::Infer(_) => false, diff --git a/packages/fortifier-macros/src/validate.rs b/packages/fortifier-macros/src/validate.rs index 0bcbaa7..d38b659 100644 --- a/packages/fortifier-macros/src/validate.rs +++ b/packages/fortifier-macros/src/validate.rs @@ -60,6 +60,7 @@ impl<'a> Validate<'a> { result.validations.push(Box::new(Custom::parse( // Type is never used in the custom validation, so pass an arbitrary value. &Type::Never(TypeNever { + attrs: Default::default(), bang_token: Default::default(), }), &meta, @@ -104,6 +105,7 @@ impl<'a> ToTokens for Validate<'a> { let context_type = match &self.context_type { Some(context_type) => context_type, None => &Type::Tuple(TypeTuple { + attrs: Default::default(), paren_token: Default::default(), elems: Punctuated::new(), }), diff --git a/packages/fortifier-macros/src/validate/type.rs b/packages/fortifier-macros/src/validate/type.rs index 343da11..173d908 100644 --- a/packages/fortifier-macros/src/validate/type.rs +++ b/packages/fortifier-macros/src/validate/type.rs @@ -418,7 +418,7 @@ pub fn should_validate_type(generics: &Generics, r#type: &Type) -> Option None, + Type::FnPtr(_) => None, Type::Group(r#type) => should_validate_type(generics, &r#type.elem), Type::ImplTrait(r#type) => { r#type.bounds