pub fn ast_path_to_ty_relaxed<'tcx,AC,RS>(
    this: &AC,
    rscope: &RS,
    did: ast::DefId,
    path: &ast::Path)
    -> TypeAndSubsts<'tcx>
    where AC : AstConv<'tcx>, RS : RegionScope
{
    let tcx = this.tcx();
    let ty::Polytype {
        generics,
        ty: decl_ty
    } = this.get_item_ty(did);

    let wants_params =
        generics.has_type_params(TypeSpace) || generics.has_region_params(TypeSpace);

    let needs_defaults =
        wants_params &&
        path.segments.iter().all(|s| s.parameters.is_empty());

    let substs = if needs_defaults {
        let type_params = Vec::from_fn(generics.types.len(TypeSpace),
                                       |_| this.ty_infer(path.span));
        let region_params =
            rscope.anon_regions(path.span, generics.regions.len(TypeSpace))
                  .unwrap();
        Substs::new(VecPerParamSpace::params_from_type(type_params),
                    VecPerParamSpace::params_from_type(region_params))
    } else {
        ast_path_substs_for_ty(this, rscope, did, &generics, None, path)
    };

    let ty = decl_ty.subst(tcx, &substs);
    TypeAndSubsts {
        substs: substs,
        ty: ty,
    }
}
/// Returns the type that this AST path refers to. If the path has no type
/// parameters and the corresponding type has type parameters, fresh type
/// and/or region variables are substituted.
///
/// This is used when checking the constructor in struct literals.
Returns the type that this AST path refers to. If the path has no type
parameters and the corresponding type has type parameters, fresh type
and/or region variables are substituted.

This is used when checking the constructor in struct literals.
Returns the type that this AST path refers to . If the path has no type parameters and the corresponding type has type parameters fresh type and / or region variables are substituted . This is used when checking the constructor in struct literals .
pub fn ast_path_to_ty_relaxed<'tcx,AC,RS>(
    this: &AC,
    rscope: &RS,
    did: ast::DefId,
    path: &ast::Path)
    -> TypeAndSubsts<'tcx>
    where AC : AstConv<'tcx>, RS : RegionScope
{
    let tcx = this.tcx();
    let ty::Polytype {
        generics,
        ty: decl_ty
    } = this.get_item_ty(did);
    let wants_params =
        generics.has_type_params(TypeSpace) || generics.has_region_params(TypeSpace);
    let needs_defaults =
        wants_params &&
        path.segments.iter().all(|s| s.parameters.is_empty());
    let substs = if needs_defaults {
        let type_params = Vec::from_fn(generics.types.len(TypeSpace),
                                       |_| this.ty_infer(path.span));
        let region_params =
            rscope.anon_regions(path.span, generics.regions.len(TypeSpace))
                  .unwrap();
        Substs::new(VecPerParamSpace::params_from_type(type_params),
                    VecPerParamSpace::params_from_type(region_params))
    } else {
        ast_path_substs_for_ty(this, rscope, did, &generics, None, path)
    };
    let ty = decl_ty.subst(tcx, &substs);
    TypeAndSubsts {
        substs: substs,
        ty: ty,
    }
}
pub fn ast_path_to_ty_relaxed < ' tcx , AC , RS > ( this : & AC , rscope : & RS , did : ast :: DefId , path : & ast :: Path ) -> TypeAndSubsts < ' tcx > where AC : AstConv < ' tcx > , RS : RegionScope { let tcx = this . tcx ( ) ; let ty :: Polytype { generics , ty : decl_ty } = this . get_item_ty ( did ) ; let wants_params = generics . has_type_params ( TypeSpace ) || generics . has_region_params ( TypeSpace ) ; let needs_defaults = wants_params && path . segments . iter ( ) . all ( | s | s . parameters . is_empty ( ) ) ; let substs = if needs_defaults { let type_params = Vec :: from_fn ( generics . types . len ( TypeSpace ) , | _ | this . ty_infer ( path . span ) ) ; let region_params = rscope . anon_regions ( path . span , generics . regions . len ( TypeSpace ) ) . unwrap ( ) ; Substs :: new ( VecPerParamSpace :: params_from_type ( type_params ) , VecPerParamSpace :: params_from_type ( region_params ) ) } else { ast_path_substs_for_ty ( this , rscope , did , & generics , None , path ) } ; let ty = decl_ty . subst ( tcx , & substs ) ; TypeAndSubsts { substs : substs , ty : ty , } }
Returns the type that this AST path refers to.
Returns the type that this AST path refers to .
this
&AC
rscope
&RS
did
ast::DefId
path
&ast::Path