Re-exportsยง
use std::iter;๐use rustc_attr_ir::find_attr;๐use rustc_attr_ir::lang_items::LangItem;๐use rustc_errors::pluralize;๐use rustc_hir as hir;๐use rustc_hir::def::DefKind;๐use rustc_hir::def::Res;๐use rustc_hir::def_id::DefId;๐use rustc_infer::traits::util::elaborate;๐use rustc_lint_defs::declare_lint;๐use rustc_lint_defs::declare_lint_pass;๐use rustc_middle::ty;๐use rustc_middle::ty::Ty;๐use rustc_middle::ty::Unnormalized;๐use rustc_span::Span;๐use rustc_span::Symbol;๐use rustc_span::sym;๐use tracing::instrument;๐use tracing::instrument;๐use crate::diagnostics::UnusedClosure;๐use crate::diagnostics::UnusedCoroutine;๐use crate::diagnostics::UnusedDef;๐use crate::diagnostics::UnusedDefSuggestion;๐use crate::diagnostics::UnusedOp;๐use crate::diagnostics::UnusedOpSuggestion;๐use crate::diagnostics::UnusedResult;๐use crate::LateContext;๐use crate::LateLintPass;๐use crate::LintContext;๐
Structsยง
Enumsยง
- IsTy
Must Use - Must the type be used?
- Must
UsePath - A path through a type to a
must_usesource. Contains useful info for the lint.
Staticsยง
- UNUSED_
MUST_ USE - The
unused_must_uselint detects unused result of a type flagged as#[must_use]. - UNUSED_
RESULTS - The
unused_resultslint checks for the unused result of an expression in a statement.
Functionsยง
- check_
fn_ ๐must_ use - Checks if
expris a [method] call expression marked as#[must_use]and emits a lint if so. Returnstrueif the lint has been emitted. - check_
must_ ๐use_ def - Returns whether further errors should be suppressed because a lint has been emitted.
- emit_
must_ ๐use_ untranslated - is_
def_ ๐must_ use - is_
ty_ must_ use - Returns
Some(path)iftyshould be considered as โmust_useโ in the context ofexpr(expris used to get the parent module, which can affect which types are considered uninhabited).