diff --git a/Cargo.lock b/Cargo.lock index 0e46a72..0f64826 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,9 +116,9 @@ checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" [[package]] name = "syn" -version = "2.0.119" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" dependencies = [ "proc-macro2", "quote", diff --git a/impl/Cargo.toml b/impl/Cargo.toml index d58644f..62ed483 100644 --- a/impl/Cargo.toml +++ b/impl/Cargo.toml @@ -18,7 +18,7 @@ proc-macro = true proc-macro2 = "1.0.106" quote = "1.0.45" regex = "1.12.4" -syn = { version = "2.0.117", features = [] } +syn = { version = "3.0.2", features = [] } [dev-dependencies] error-stack = "0.8.0" diff --git a/impl/src/types/util.rs b/impl/src/types/util.rs index 42ef080..fc1482a 100644 --- a/impl/src/types/util.rs +++ b/impl/src/types/util.rs @@ -2,7 +2,7 @@ use proc_macro2::TokenStream as TokenStream2; use quote::{ToTokens, quote}; use syn::{ Attribute, GenericParam, Ident, Lifetime, Path, TraitBound, - TraitBoundModifier, TypeParamBound, + TraitBoundModifiers, TypeParamBound, punctuated::Punctuated, spanned::Spanned as _, token::{Colon, Comma}, @@ -59,12 +59,10 @@ pub(crate) fn remove_generic_default(param: &mut GenericParam) { use GenericParam as GP; match *param { GP::Const(ref mut const_p) => { - const_p.eq_token = None; const_p.default = None; } GP::Type(ref mut type_p) => { - type_p.eq_token = None; type_p.default = None; } @@ -113,8 +111,9 @@ pub(crate) fn add_debug_trait_bound(param: &mut GenericParam) { type_p.colon_token = Some(Colon(type_p.span())); type_p.bounds.push(TypeParamBound::Trait(TraitBound { paren_token: None, - modifier: TraitBoundModifier::None, lifetimes: None, + modifiers: TraitBoundModifiers::default(), + maybe: None, path: trait_path, })); }