Module attrs

Module attrs 

Source
Expand description

Utility functions for attributes, including Clippy’s built-in ones

Structs§

LimitStack
Currently used to keep track of the current value of #[clippy::cognitive_complexity(N)]

Functions§

get_builtin_attr
Given attrs, extract all the instances of a built-in Clippy attribute called name
get_unique_builtin_attr
If attrs contain exactly one instance of a built-in Clippy attribute called name, returns that attribute, and None otherwise
has_non_exhaustive_attr
Checks whether the given ADT, or any of its fields/variants, are marked as #[non_exhaustive]
is_doc_hidden
Checks whether attrs contain #[doc(hidden)]
is_proc_macro
Checks whether attrs contain any of proc_macro, proc_macro_derive or proc_macro_attribute
parse_attrs 🔒
span_contains_cfg
Checks whether the given span contains a #[cfg(..)] attribute