Use #[expect(lint)] over #[allow(lint)] where possible (#17822)

This commit is contained in:
Micha Reiser 2025-05-03 21:20:31 +02:00 committed by GitHub
parent 8535af8516
commit fa628018b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
148 changed files with 221 additions and 268 deletions

View file

@ -19,7 +19,7 @@ pub(crate) fn derive_impl(input: DeriveInput) -> syn::Result<proc_macro2::TokenS
#[automatically_derived]
impl crate::configuration::CombinePluginOptions for #ident {
fn combine(self, other: Self) -> Self {
#[allow(deprecated)]
#[expect(deprecated)]
Self {
#(
#output

View file

@ -48,7 +48,7 @@ pub(super) fn generate_newtype_index(item: ItemStruct) -> syn::Result<proc_macro
//
// N.B. We have to use the unchecked variant here because we're
// in a const context and Option::unwrap isn't const yet.
#[allow(unsafe_code)]
#[expect(unsafe_code)]
Self(unsafe { std::num::NonZeroU32::new_unchecked((value as u32) + 1) })
}
@ -61,7 +61,7 @@ pub(super) fn generate_newtype_index(item: ItemStruct) -> syn::Result<proc_macro
//
// N.B. We have to use the unchecked variant here because we're
// in a const context and Option::unwrap isn't const yet.
#[allow(unsafe_code)]
#[expect(unsafe_code)]
Self(unsafe { std::num::NonZeroU32::new_unchecked(value + 1) })
}

View file

@ -9,7 +9,7 @@ pub(crate) fn violation_metadata(input: DeriveInput) -> syn::Result<TokenStream>
Ok(quote! {
#[automatically_derived]
#[allow(deprecated)]
#[expect(deprecated)]
impl ruff_diagnostics::ViolationMetadata for #name {
fn rule_name() -> &'static str {
stringify!(#name)