# Function rustc_middle::lint::lint_level

source ·

    pub fn lint_level(
        sess: &Session,
        lint: &'static Lint,
        level: Level,
        src: LintLevelSource,
        span: Option<MultiSpan>,
        decorate: impl for<'a, 'b> FnOnce(&'b mut Diag<'a, ()>),
    )

Expand description

The innermost function for emitting lints.

If you are looking to implement a lint, look for higher level functions, for example:

- `TyCtxt::emit_node_span_lint`
- `TyCtxt::node_span_lint`
- `TyCtxt::emit_node_lint`
- `TyCtxt::node_lint`
- `LintContext::opt_span_lint`

### §`decorate`

It is not intended to call `emit`/`cancel` on the `Diag` passed in the `decorate` callback.