Update syn crate from 1.0.109 to 2.0.101 (#31301)
Nearly all generated by Zed Agent + Claude Opus 4. I just wrote the test `Args` struct and pointed it at the [2.0 release notes](https://github.com/dtolnay/syn/releases/tag/2.0.0). Release Notes: - N/A
This commit is contained in:
parent
208f525a11
commit
f3c2e71ca7
6 changed files with 155 additions and 90 deletions
|
@ -16,25 +16,20 @@ pub fn derive_refineable(input: TokenStream) -> TokenStream {
|
|||
..
|
||||
} = parse_macro_input!(input);
|
||||
|
||||
let refineable_attr = attrs.iter().find(|attr| attr.path.is_ident("refineable"));
|
||||
let refineable_attr = attrs.iter().find(|attr| attr.path().is_ident("refineable"));
|
||||
|
||||
let mut impl_debug_on_refinement = false;
|
||||
let mut refinement_traits_to_derive = vec![];
|
||||
|
||||
if let Some(refineable_attr) = refineable_attr {
|
||||
if let Ok(syn::Meta::List(meta_list)) = refineable_attr.parse_meta() {
|
||||
for nested in meta_list.nested {
|
||||
let syn::NestedMeta::Meta(syn::Meta::Path(path)) = nested else {
|
||||
continue;
|
||||
};
|
||||
|
||||
if path.is_ident("Debug") {
|
||||
impl_debug_on_refinement = true;
|
||||
} else {
|
||||
refinement_traits_to_derive.push(path);
|
||||
}
|
||||
let _ = refineable_attr.parse_nested_meta(|meta| {
|
||||
if meta.path.is_ident("Debug") {
|
||||
impl_debug_on_refinement = true;
|
||||
} else {
|
||||
refinement_traits_to_derive.push(meta.path);
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
});
|
||||
}
|
||||
|
||||
let refinement_ident = format_ident!("{}Refinement", ident);
|
||||
|
@ -325,7 +320,9 @@ pub fn derive_refineable(input: TokenStream) -> TokenStream {
|
|||
}
|
||||
|
||||
fn is_refineable_field(f: &Field) -> bool {
|
||||
f.attrs.iter().any(|attr| attr.path.is_ident("refineable"))
|
||||
f.attrs
|
||||
.iter()
|
||||
.any(|attr| attr.path().is_ident("refineable"))
|
||||
}
|
||||
|
||||
fn is_optional_field(f: &Field) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue