Expand description
Utility functions for attributes, including Clippyβs built-in ones
Re-exportsΒ§
use crate::source::SpanExt as _;πuse crate::sym;πuse crate::tokenize_with_text;πuse rustc_ast::attr::AttributeExt;πuse rustc_attr_ir::AttrArgs;πuse rustc_attr_ir::find_attr;πuse rustc_errors::Applicability;πuse rustc_hir::def_id::DefId;πuse rustc_lexer::TokenKind;πuse rustc_lint::LateContext;πuse rustc_middle::ty::AdtDef;πuse rustc_middle::ty::TyCtxt;πuse rustc_session::Session;πuse rustc_span::Span;πuse rustc_span::Symbol;πuse std::str::FromStr as _;π
StructsΒ§
- Limit
Stack - Currently used to keep track of the current value of
#[clippy::cognitive_complexity(N)]
FunctionsΒ§
- check_
clippy_ attr - Validates a single clippy attribute and emits errors for unknown or deprecated ones.
- get_
clippy_ attr - Returns the first occurrence of
#[clippy::<name>]. - 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
attrscontain#[doc(hidden)] - is_
proc_ macro - Checks whether
attrscontain any ofproc_macro,proc_macro_deriveorproc_macro_attribute - parse_
attrs π - span_
contains_ πattr_ idents - span_
contains_ cfg - Checks whether the given span contains a
#[cfg(..)]attribute - span_
contains_ cfg_ or_ cfg_ attr - Checks whether the given span contains a
#[cfg(..)]or#[cfg_attr(..)]attribute - span_
of_ clippy_ attr - Retrieves the span of a Clippy attribute, such as
#[clippy::format_args].