# Function rustc_middle::lint::struct_lint_level

source ·

    pub fn struct_lint_level(
        sess: &Session,
        lint: &'static Lint,
        level: Level,
        src: LintLevelSource,
        span: Option<MultiSpan>,
        msg: impl Into<DiagnosticMessage>,
        decorate: impl for<'a, 'b> FnOnce(&'b mut DiagnosticBuilder<'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_spanned_lint`
- `TyCtxt::struct_span_lint_hir`
- `TyCtxt::emit_lint`
- `TyCtxt::struct_lint_node`
- `LintContext::lookup`

### `decorate`

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