fn resolve_ty_as_possible_inner(&mut self, tv_stack: &mut Vec<TypeVarId>, ty: Ty) -> Ty {
        ty.fold(&mut |ty| match ty {
            Ty::Infer(tv) => {
                let inner = tv.to_inner();
                if tv_stack.contains(&inner) {
                    tested_by!(type_var_cycles_resolve_as_possible);
                    // recursive type
                    return tv.fallback_value();
                }
                if let Some(known_ty) =
                    self.var_unification_table.inlined_probe_value(inner).known()
                {
                    // known_ty may contain other variables that are known by now
                    tv_stack.push(inner);
                    let result = self.resolve_ty_as_possible_inner(tv_stack, known_ty.clone());
                    tv_stack.pop();
                    result
                } else {
                    ty
                }
            }
            _ => ty,
        })
    }
/// Resolves the type as far as currently possible, replacing type variables
/// by their known types. All types returned by the infer_* functions should
/// be resolved as far as possible, i.e. contain no type variables with
/// known type.
Resolves the type as far as currently possible, replacing type variables
by their known types. All types returned by the infer_* functions should
be resolved as far as possible, i.e. contain no type variables with
known type.
Resolves the type as far as currently possible replacing type variables by their known types . All types returned by the infer_ * functions should be resolved as far as possible i . e . contain no type variables with known type .
fn resolve_ty_as_possible_inner(&mut self, tv_stack: &mut Vec<TypeVarId>, ty: Ty) -> Ty {
        ty.fold(&mut |ty| match ty {
            Ty::Infer(tv) => {
                let inner = tv.to_inner();
                if tv_stack.contains(&inner) {
                    tested_by!(type_var_cycles_resolve_as_possible);
                    // recursive type
                    return tv.fallback_value();
                }
                if let Some(known_ty) =
                    self.var_unification_table.inlined_probe_value(inner).known()
                {
                    // known_ty may contain other variables that are known by now
                    tv_stack.push(inner);
                    let result = self.resolve_ty_as_possible_inner(tv_stack, known_ty.clone());
                    tv_stack.pop();
                    result
                } else {
                    ty
                }
            }
            _ => ty,
        })
    }
fn resolve_ty_as_possible_inner ( & mut self , tv_stack : & mut Vec < TypeVarId > , ty : Ty ) -> Ty { ty . fold ( & mut | ty | match ty { Ty :: Infer ( tv ) => { let inner = tv . to_inner ( ) ; if tv_stack . contains ( & inner ) { tested_by ! ( type_var_cycles_resolve_as_possible ) ; // recursive type return tv . fallback_value ( ) ; } if let Some ( known_ty ) = self . var_unification_table . inlined_probe_value ( inner ) . known ( ) { // known_ty may contain other variables that are known by now tv_stack . push ( inner ) ; let result = self . resolve_ty_as_possible_inner ( tv_stack , known_ty . clone ( ) ) ; tv_stack . pop ( ) ; result } else { ty } } _ => ty , } ) }
Resolves the type as far as currently possible, replacing type variables
by their known types.
Resolves the type as far as currently possible replacing type variables by their known types .
&mut self
tv_stack
&mut Vec<TypeVarId>
ty
Ty