print_crate_root_lint_levels - The Rust Unstable Book

## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# `print=crate-root-lint-levels`

The tracking issue for this feature is: #139180.

This option of the `--print` flag print the list of lints with print out all the lints and their associated levels (`allow`, `warn`, `deny`, `forbid`) based on the regular Rust rules at crate root, that is (roughly):

- command line args (`-W`, `-A`, `--force-warn`, `--cap-lints`, …)
- crate root attributes (`#![allow]`, `#![warn]`, `#[expect]`, …)
- the special `warnings` lint group
- the default lint level

The output format is `LINT_NAME=LINT_LEVEL`, e.g.:

    unknown_lint=warn
    arithmetic_overflow=deny

To be used like this:

    rustc --print=crate-root-lint-levels -Zunstable-options lib.rs