Module conv

Module conv 

Source
Expand description

Conversion from types in fhir to types in rty

Conversion assumes well-formedness and will panic if type are not well-formed. Among other things, well-formedness implies:

  1. Names are bound correctly.
  2. Refinement parameters appear in allowed positions. This is particularly important for refinement predicates, aka abstract refinements, since the syntax in rty has syntactic restrictions on predicates.
  3. Refinements are well-sorted.

ModulesΒ§

errors πŸ”’
struct_compat
Check whether two refinemnt types/signatures are structurally compatible.

StructsΒ§

AfterSortck πŸ”’
AssocReftTag πŸ”’
ConvCtxt
Wrapper over a type implementing ConvPhase. We have this to implement most functionality as inherent methods instead of defining them as default implementation in the trait definition.
Env πŸ”’
Layer πŸ”’
LookupResult πŸ”’
ParamEntry πŸ”’

EnumsΒ§

LayerKind πŸ”’
Whether the list of parameters in a layer is converted into a list of bound variables or coalesced into a single parameter of adt sort.
LookupResultKind πŸ”’

TraitsΒ§

AssocItemTag πŸ”’
This trait is used to define functions generically over both associated refinements and associated items (types, consts, and functions).
ConvPhase
We do conversion twice: once before sort checking when we don’t have elaborated information and then again after sort checking after all information has been elaborated. This is the interface to configure conversion for both phases.
WfckResultsProvider
An interface to the information elaborated during sort checking. We mock these results in the first conversion phase during sort checking.

FunctionsΒ§

conv_adt_sort_def πŸ”’
conv_constant πŸ”’
conv_default_type_parameter πŸ”’
conv_func_decl
conv_generic_param_kind πŸ”’
conv_generics πŸ”’
conv_refinement_generics πŸ”’
conv_un_op πŸ”’
def_id_to_param_const πŸ”’
def_id_to_param_ty πŸ”’
prim_ty_to_bty πŸ”’
transitive_bounds πŸ”’
This is like traits::transitive_bounds_that_define_assoc_item but computes all bounds not just the ones defining an associated item. We must compute this ourselves to resolve type-relative associated refinements.
ty_param_name πŸ”’
ty_param_owner πŸ”’
type_param_predicates πŸ”’
This is like TyCtxt::type_param_predicates but computes all bounds not just the ones defining an associated item. We must compute this ourselves to resolve type-relative associated refinements, but we also use it to resolve type-relative type paths.
variant_idx πŸ”’