Some lints are emitted from a from a different from the area they are linted. e.g. clippy::ptr_arg is linting from check_body, but it can be allowed from the argument (fn foo(#[allow(clippy::ptr_arg)] x: &Vec<u32>) {}).
The following lints in clippy (and probably more) lint from different check_* functions:
needless_borrow
ref_binding_to_ref
duplicate_mod
multiple_inherent_impl
macro_use_imports
manual_non_exhaustive
same_name_method
async_yields_async
await_holding_lock
await_holding_refcell
await_holding_invalid_type
default_numeric_fallback
ptr_arg
redundant_clone
logic_bug
nonminimal_bool
boxed_local
implicit_return
needless_return
unnecessary_unwrap
panicking_unwrap
Some of these don't actually work with allow at a narrower scope either, but some of them check to see if the lint has been allowed on the target item before emitting the lint.
cc #54503
Some lints are emitted from a from a different from the area they are linted. e.g.
clippy::ptr_argis linting fromcheck_body, but it can be allowed from the argument (fn foo(#[allow(clippy::ptr_arg)] x: &Vec<u32>) {}).The following lints in clippy (and probably more) lint from different
check_*functions:needless_borrowref_binding_to_refduplicate_modmultiple_inherent_implmacro_use_importsmanual_non_exhaustivesame_name_methodasync_yields_asyncawait_holding_lockawait_holding_refcellawait_holding_invalid_typedefault_numeric_fallbackptr_argredundant_clonelogic_bugnonminimal_boolboxed_localimplicit_returnneedless_returnunnecessary_unwrappanicking_unwrapSome of these don't actually work with
allowat a narrower scope either, but some of them check to see if the lint has been allowed on the target item before emitting the lint.cc #54503