Module clippy_utils::ty::type_certainty
source · Expand description
A heuristic to tell whether an expression’s type can be determined purely from its
subexpressions, and the arguments and locals they use. Put another way, expr_type_is_certain
tries to tell whether an expression’s type can be determined without appeal to the surrounding
context.
This is, in some sense, a counterpart to let_unit_value
’s expr_needs_inferred_result
.
Intuitively, that function determines whether an expression’s type is needed for type inference,
whereas expr_type_is_certain
determines whether type inference is needed for an expression’s
type.
As a heuristic, expr_type_is_certain
may produce false negatives, but a false positive should
be considered a bug.
Modules
Structs
Functions
- Tries to tell whether a
QPath
resolves to something certain, e.g., whether all of its path segments generic arguments are instantiated. - self_ty 🔒
- For at least some
QPath::TypeRelative
, the path segment’sres
can beRes::Err
.update_res
tries to fix the resolution whenparent_certainty
isCertain(Some(..))
.