mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:24:57 +00:00
Revert "Upgrade to Rust 1.82 toolchain" (#13810)
This commit is contained in:
parent
ff72055558
commit
6d7da7bdbe
11 changed files with 51 additions and 55 deletions
|
@ -75,11 +75,12 @@ pub(crate) fn derive_cache_key(item: &DeriveInput) -> syn::Result<TokenStream> {
|
|||
}
|
||||
}
|
||||
|
||||
let field_attr = if let Some(ident) = &field.ident {
|
||||
quote!(self.#ident)
|
||||
} else {
|
||||
let index = syn::Index::from(i);
|
||||
quote!(self.#index)
|
||||
let field_attr = match &field.ident {
|
||||
Some(ident) => quote!(self.#ident),
|
||||
None => {
|
||||
let index = syn::Index::from(i);
|
||||
quote!(self.#index)
|
||||
}
|
||||
};
|
||||
|
||||
fields.push(quote!(#field_attr.cache_key(key);));
|
||||
|
|
|
@ -143,10 +143,9 @@ pub(crate) fn map_codes(func: &ItemFn) -> syn::Result<TokenStream> {
|
|||
for (prefix, rules) in &rules_by_prefix {
|
||||
let prefix_ident = get_prefix_ident(prefix);
|
||||
let attrs = intersection_all(rules.iter().map(|(.., attrs)| attrs.as_slice()));
|
||||
let attrs = if attrs.is_empty() {
|
||||
quote!()
|
||||
} else {
|
||||
quote!(#(#attrs)*)
|
||||
let attrs = match attrs.as_slice() {
|
||||
[] => quote!(),
|
||||
[..] => quote!(#(#attrs)*),
|
||||
};
|
||||
all_codes.push(quote! {
|
||||
#attrs Self::#linter(#linter::#prefix_ident)
|
||||
|
@ -162,10 +161,9 @@ pub(crate) fn map_codes(func: &ItemFn) -> syn::Result<TokenStream> {
|
|||
});
|
||||
let prefix_ident = get_prefix_ident(&prefix);
|
||||
let attrs = intersection_all(rules.iter().map(|(.., attrs)| attrs.as_slice()));
|
||||
let attrs = if attrs.is_empty() {
|
||||
quote!()
|
||||
} else {
|
||||
quote!(#(#attrs)*)
|
||||
let attrs = match attrs.as_slice() {
|
||||
[] => quote!(),
|
||||
[..] => quote!(#(#attrs)*),
|
||||
};
|
||||
prefix_into_iter_match_arms.extend(quote! {
|
||||
#attrs #linter::#prefix_ident => vec![#(#rule_paths,)*].into_iter(),
|
||||
|
|
|
@ -90,10 +90,9 @@ fn attributes_for_prefix(
|
|||
attributes: &BTreeMap<String, &[Attribute]>,
|
||||
) -> proc_macro2::TokenStream {
|
||||
let attrs = intersection_all(codes.iter().map(|code| attributes[code]));
|
||||
if attrs.is_empty() {
|
||||
quote!()
|
||||
} else {
|
||||
quote!(#(#attrs)*)
|
||||
match attrs.as_slice() {
|
||||
[] => quote!(),
|
||||
[..] => quote!(#(#attrs)*),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue