Skip to main content

Module opaque_types

Module opaque_types 

Source

ModulesΒ§

member_constraints πŸ”’
region_ctxt πŸ”’

StructsΒ§

DefiningUse πŸ”’
ToArgRegionsFolder πŸ”’
A folder to map the regions in the hidden type to their corresponding arg_regions.
UnexpectedHiddenRegion πŸ”’
Record info needed to report the same name error later.

EnumsΒ§

DeferredOpaqueTypeError πŸ”’
We defer errors from [fn handle_opaque_type_uses] and only report them if there are no RegionErrors. If there are region errors, it’s likely that errors here are caused by them and don’t need to be handled separately.

TraitsΒ§

InferCtxtExt

FunctionsΒ§

add_hidden_type πŸ”’
Collect all defining uses of opaque types inside of this typeck root. This expects the hidden type to be mapped to the definition parameters of the opaque and errors if we end up with distinct hidden types.
apply_definition_site_hidden_types πŸ”’
This function is what actually applies member constraints to the borrowck state. It is also responsible to check all uses of the opaques in their defining scope.
clone_and_resolve_opaque_types πŸ”’
We eagerly map all regions to NLL vars here, as we need to make sure we’ve introduced nll vars for all used placeholders.
collect_defining_uses πŸ”’
compute_definition_site_hidden_types πŸ”’
This computes the actual hidden types of the opaque types and maps them to their definition sites. Outside of registering the computed hidden types this function does not mutate the current borrowck state.
compute_definition_site_hidden_types_from_defining_uses πŸ”’
detect_opaque_types_added_while_handling_opaque_types πŸ”’
In theory apply_definition_site_hidden_types could introduce new uses of opaque types. We do not check these new uses so this could be unsound.
handle_unconstrained_hidden_type_errors πŸ”’
We handle UnexpectedHiddenRegion error lazily in the next solver as there may be a fully defining use in another body.
nll_var_to_universal_region πŸ”’
Maps an NLL var to a deterministically chosen equal universal region.