Skip to main content

Module lint

Module lint 

Source

Re-exportsยง

use std::sync::LazyLock as Lazy; ๐Ÿ”’
use rustc_data_structures::fx::FxHashMap; ๐Ÿ”’
use rustc_lint as lint; ๐Ÿ”’
use rustc_lint::Lint; ๐Ÿ”’
use rustc_lint::LintId; ๐Ÿ”’
use rustc_lint::LintStore; ๐Ÿ”’
use rustc_lint::declare_tool_lint; ๐Ÿ”’
use rustc_session::Session; ๐Ÿ”’

Macrosยง

declare_rustdoc_lint ๐Ÿ”’

Staticsยง

BARE_URLS
The bare_urls lint detects when a URL is not a hyperlink. This is a rustdoc only lint, see the documentation in the rustdoc book.
BROKEN_FOOTNOTE
This lint checks for uses of footnote references without definition.
BROKEN_INTRA_DOC_LINKS
The broken_intra_doc_links lint detects failures in resolving intra-doc link targets. This is a rustdoc only lint, see the documentation in the rustdoc book.
INVALID_CODEBLOCK_ATTRIBUTES
The invalid_codeblock_attributes lint detects code block attributes in documentation examples that have potentially mis-typed values. This is a rustdoc only lint, see the documentation in the rustdoc book.
INVALID_HTML_TAGS
The invalid_html_tags lint detects invalid HTML tags. This is a rustdoc only lint, see the documentation in the rustdoc book.
INVALID_MARKDOWN_TABLE
This lint is warn-by-default. It detects unescaped pipes in table rows which lead to some row cells being ignored. This is a rustdoc only lint, see the documentation in the rustdoc book.
INVALID_RUST_CODEBLOCKS
The invalid_rust_codeblocks lint detects Rust code blocks in documentation examples that are invalid (e.g. empty, not parsable as Rust code). This is a rustdoc only lint, see the documentation in the rustdoc book.
MISSING_CRATE_LEVEL_DOCS
The missing_crate_level_docs lint detects if documentation is missing at the crate root. This is a rustdoc only lint, see the documentation in the rustdoc book.
MISSING_DOC_CODE_EXAMPLES
The missing_doc_code_examples lint detects publicly-exported items without code samples in their documentation. This is a rustdoc only lint, see the documentation in the rustdoc book.
PRIVATE_DOC_TESTS
The private_doc_tests lint detects code samples in docs of private items not documented by rustdoc. This is a rustdoc only lint, see the documentation in the rustdoc book.
PRIVATE_INTRA_DOC_LINKS
This is a subset of broken_intra_doc_links that warns when linking from a public item to a private one. This is a rustdoc only lint, see the documentation in the rustdoc book.
REDUNDANT_EXPLICIT_LINKS
This lint is warn-by-default. It detects explicit links that are the same as computed automatic links. This usually means the explicit links are removable. This is a rustdoc only lint, see the documentation in the rustdoc book.
RUSTDOC_LINTS ๐Ÿ”’
UNESCAPED_BACKTICKS
The unescaped_backticks lint detects unescaped backticks (`), which usually mean broken inline code. This is a rustdoc only lint, see the documentation in the rustdoc book.
UNUSED_FOOTNOTE_DEFINITION
This lint checks if all footnote definitions are used.

Functionsยง

init_lints ๐Ÿ”’
This function is used to setup the lint initialization. By default, in rustdoc, everything is โ€œallowedโ€. Depending if we run in test mode or not, we want some of them to be at their default level. For example, the โ€œINVALID_CODEBLOCK_ATTRIBUTESโ€ lint is activated in both modes.
register_lints ๐Ÿ”’