fn resolve_ty_completely_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_completely);
                    // 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_completely_inner(tv_stack, known_ty.clone());
                    tv_stack.pop();
                    result
                } else {
                    tv.fallback_value()
                }
            }
            _ => ty,
        })
    }
/// Resolves the type completely; type variables without known type are
/// replaced by Ty::Unknown.
Resolves the type completely; type variables without known type are
replaced by Ty::Unknown.
Resolves the type completely ; type variables without known type are replaced by Ty :: Unknown .
fn resolve_ty_completely_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_completely);
                    // 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_completely_inner(tv_stack, known_ty.clone());
                    tv_stack.pop();
                    result
                } else {
                    tv.fallback_value()
                }
            }
            _ => ty,
        })
    }
fn resolve_ty_completely_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_completely ) ; // 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_completely_inner ( tv_stack , known_ty . clone ( ) ) ; tv_stack . pop ( ) ; result } else { tv . fallback_value ( ) } } _ => ty , } ) }
Resolves the type completely; type variables without known type are
replaced by Ty::Unknown.
Resolves the type completely ; type variables without known type are replaced by Ty :: Unknown .
&mut self
tv_stack
&mut Vec<TypeVarId>
ty
Ty