Skip to main content

Module must_use

Module must_use 

Source

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ยง

UnusedResults

Enumsยง

IsTyMustUse
Must the type be used?
MustUsePath
A path through a type to a must_use source. Contains useful info for the lint.

Staticsยง

UNUSED_MUST_USE
The unused_must_use lint detects unused result of a type flagged as #[must_use].
UNUSED_RESULTS
The unused_results lint checks for the unused result of an expression in a statement.

Functionsยง

check_fn_must_use ๐Ÿ”’
Checks if expr is a [method] call expression marked as #[must_use] and emits a lint if so. Returns true if 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) if ty should be considered as โ€œmust_useโ€ in the context of expr (expr is used to get the parent module, which can affect which types are considered uninhabited).