55//! - Building the type for an item: This happens through the `type_for_def` query.
66//!
77//! This usually involves resolving names, collecting generic arguments etc.
8- use std:: cell:: { Cell , RefCell } ;
9- use std:: { iter, sync:: Arc } ;
8+ use std:: {
9+ cell:: { Cell , RefCell } ,
10+ iter,
11+ sync:: Arc ,
12+ } ;
1013
1114use base_db:: CrateId ;
12- use chalk_ir:: fold:: Fold ;
13- use chalk_ir:: interner:: HasInterner ;
14- use chalk_ir:: { cast:: Cast , fold:: Shift , Mutability , Safety } ;
15- use hir_def:: generics:: TypeOrConstParamData ;
16- use hir_def:: intern:: Interned ;
17- use hir_def:: lang_item:: lang_attr;
18- use hir_def:: path:: { ModPath , PathKind } ;
19- use hir_def:: type_ref:: ConstScalarOrPath ;
15+ use chalk_ir:: { cast:: Cast , fold:: Fold , fold:: Shift , interner:: HasInterner , Mutability , Safety } ;
16+
2017use hir_def:: {
2118 adt:: StructKind ,
2219 body:: { Expander , LowerCtx } ,
2320 builtin_type:: BuiltinType ,
24- generics:: { TypeParamProvenance , WherePredicate , WherePredicateTypeTarget } ,
25- path:: { GenericArg , Path , PathSegment , PathSegments } ,
21+ generics:: {
22+ TypeOrConstParamData , TypeParamProvenance , WherePredicate , WherePredicateTypeTarget ,
23+ } ,
24+ intern:: Interned ,
25+ lang_item:: lang_attr,
26+ path:: { GenericArg , ModPath , Path , PathKind , PathSegment , PathSegments } ,
2627 resolver:: { HasResolver , Resolver , TypeNs } ,
27- type_ref:: { TraitBoundModifier , TraitRef as HirTraitRef , TypeBound , TypeRef } ,
28- AdtId , AssocItemId , ConstId , EnumId , EnumVariantId , FunctionId , GenericDefId , HasModule ,
29- ImplId , ItemContainerId , LocalFieldId , Lookup , StaticId , StructId , TraitId , TypeAliasId ,
30- UnionId , VariantId ,
28+ type_ref:: {
29+ ConstScalarOrPath , TraitBoundModifier , TraitRef as HirTraitRef , TypeBound , TypeRef ,
30+ } ,
31+ AdtId , AssocItemId , ConstId , ConstParamId , EnumId , EnumVariantId , FunctionId , GenericDefId ,
32+ HasModule , ImplId , ItemContainerId , LocalFieldId , Lookup , StaticId , StructId , TraitId ,
33+ TypeAliasId , TypeOrConstParamId , TypeParamId , UnionId , VariantId ,
3134} ;
32- use hir_def:: { ConstParamId , TypeOrConstParamId , TypeParamId } ;
3335use hir_expand:: { name:: Name , ExpandResult } ;
3436use itertools:: Either ;
3537use la_arena:: ArenaMap ;
@@ -38,20 +40,19 @@ use smallvec::SmallVec;
3840use stdx:: { impl_from, never} ;
3941use syntax:: { ast, SmolStr } ;
4042
41- use crate :: consteval:: {
42- intern_scalar_const, path_to_const, unknown_const, unknown_const_as_generic,
43- } ;
44- use crate :: utils:: Generics ;
45- use crate :: { all_super_traits, make_binders, Const , GenericArgData , ParamKind } ;
4643use crate :: {
44+ all_super_traits,
45+ consteval:: { intern_scalar_const, path_to_const, unknown_const, unknown_const_as_generic} ,
4746 db:: HirDatabase ,
47+ make_binders,
4848 mapping:: ToChalk ,
4949 static_lifetime, to_assoc_type_id, to_chalk_trait_id, to_placeholder_idx,
50+ utils:: Generics ,
5051 utils:: { all_super_trait_refs, associated_type_by_name_including_super_traits, generics} ,
51- AliasEq , AliasTy , Binders , BoundVar , CallableSig , DebruijnIndex , DynTy , FnPointer , FnSig ,
52- FnSubst , ImplTraitId , Interner , PolyFnSig , ProjectionTy , QuantifiedWhereClause ,
53- QuantifiedWhereClauses , ReturnTypeImplTrait , ReturnTypeImplTraits , Substitution ,
54- TraitEnvironment , TraitRef , TraitRefExt , Ty , TyBuilder , TyKind , WhereClause ,
52+ AliasEq , AliasTy , Binders , BoundVar , CallableSig , Const , DebruijnIndex , DynTy , FnPointer ,
53+ FnSig , FnSubst , GenericArgData , ImplTraitId , Interner , ParamKind , PolyFnSig , ProjectionTy ,
54+ QuantifiedWhereClause , QuantifiedWhereClauses , ReturnTypeImplTrait , ReturnTypeImplTraits ,
55+ Substitution , TraitEnvironment , TraitRef , TraitRefExt , Ty , TyBuilder , TyKind , WhereClause ,
5556} ;
5657
5758#[ derive( Debug ) ]
0 commit comments