mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Use #[expect(lint)]
over #[allow(lint)]
where possible (#17822)
This commit is contained in:
parent
8535af8516
commit
fa628018b2
148 changed files with 221 additions and 268 deletions
|
@ -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
|
||||
|
|
|
@ -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) })
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue