Module 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§

certainty 🔒

Structs§

CertaintyVisitor 🔒

Functions§

adt_def_id 🔒
contains_param 🔒
expr_type_certainty 🔒
expr_type_is_certain
generic_args_certainty 🔒
path_segment_certainty 🔒
qpath_certainty 🔒
Tries to tell whether a QPath resolves to something certain, e.g., whether all of its path segments generic arguments are instantiated.
self_ty 🔒
type_certainty 🔒
type_is_inferable_from_arguments 🔒
update_res 🔒
For at least some QPath::TypeRelative, the path segment’s res can be Res::Err. update_res tries to fix the resolution when parent_certainty is Certain(Some(..)).