is_lint_allowed in clippy_utils - Rust
Description: Returns `true` if the lint is allowed in the current context. This is useful for skipping long running code when it’s unnecessary

Skip to main content

## is_lint_allowed

# Function is_lint_allowed

Source

    pub fn is_lint_allowed(
        cx: &LateContext<'_>,
        lint: &'static Lint,
        id: HirId,
    ) -> bool

Expand description

Returns `true` if the lint is allowed in the current context. This is useful for skipping long running code when it’s unnecessary

This function should check the lint level for the same node, that the lint will be emitted at. If the information is buffered to be emitted at a later point, please make sure to use `span_lint_hir` functions to emit the lint. This ensures that expectations at the checked nodes will be fulfilled.