Skip to main content

Module must_use

Module must_use 

Source

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).