1
1
use chalk_ir:: interner:: HasInterner ;
2
2
use chalk_ir:: {
3
- self , AdtId , BoundVar , ClosureId , DebruijnIndex , FnDefId , GeneratorId , OpaqueTyId , TraitId ,
3
+ self , AdtId , BoundVar , ClosureId , CoroutineId , DebruijnIndex , FnDefId , OpaqueTyId , TraitId ,
4
4
VariableKinds ,
5
5
} ;
6
6
use chalk_ir:: { cast:: Cast , ForeignDefId , WithKind } ;
@@ -16,15 +16,15 @@ pub type AdtIds = BTreeMap<Ident, chalk_ir::AdtId<ChalkIr>>;
16
16
pub type FnDefIds = BTreeMap < Ident , chalk_ir:: FnDefId < ChalkIr > > ;
17
17
pub type ClosureIds = BTreeMap < Ident , chalk_ir:: ClosureId < ChalkIr > > ;
18
18
pub type TraitIds = BTreeMap < Ident , chalk_ir:: TraitId < ChalkIr > > ;
19
- pub type GeneratorIds = BTreeMap < Ident , chalk_ir:: GeneratorId < ChalkIr > > ;
19
+ pub type CoroutineIds = BTreeMap < Ident , chalk_ir:: CoroutineId < ChalkIr > > ;
20
20
pub type OpaqueTyIds = BTreeMap < Ident , chalk_ir:: OpaqueTyId < ChalkIr > > ;
21
21
pub type AdtKinds = BTreeMap < chalk_ir:: AdtId < ChalkIr > , TypeKind > ;
22
22
pub type FnDefKinds = BTreeMap < chalk_ir:: FnDefId < ChalkIr > , TypeKind > ;
23
23
pub type ClosureKinds = BTreeMap < chalk_ir:: ClosureId < ChalkIr > , TypeKind > ;
24
24
pub type TraitKinds = BTreeMap < chalk_ir:: TraitId < ChalkIr > , TypeKind > ;
25
25
pub type AutoTraits = BTreeMap < chalk_ir:: TraitId < ChalkIr > , bool > ;
26
26
pub type OpaqueTyVariableKinds = BTreeMap < chalk_ir:: OpaqueTyId < ChalkIr > , TypeKind > ;
27
- pub type GeneratorKinds = BTreeMap < chalk_ir:: GeneratorId < ChalkIr > , TypeKind > ;
27
+ pub type CoroutineKinds = BTreeMap < chalk_ir:: CoroutineId < ChalkIr > , TypeKind > ;
28
28
pub type AssociatedTyLookups = BTreeMap < ( chalk_ir:: TraitId < ChalkIr > , Ident ) , AssociatedTyLookup > ;
29
29
pub type AssociatedTyValueIds =
30
30
BTreeMap < ( chalk_ir:: ImplId < ChalkIr > , Ident ) , AssociatedTyValueId < ChalkIr > > ;
@@ -49,8 +49,8 @@ pub struct Env<'k> {
49
49
pub associated_ty_lookups : & ' k AssociatedTyLookups ,
50
50
pub auto_traits : & ' k AutoTraits ,
51
51
pub foreign_ty_ids : & ' k ForeignIds ,
52
- pub generator_ids : & ' k GeneratorIds ,
53
- pub generator_kinds : & ' k GeneratorKinds ,
52
+ pub coroutine_ids : & ' k CoroutineIds ,
53
+ pub coroutine_kinds : & ' k CoroutineKinds ,
54
54
/// GenericArg identifiers are used as keys, therefore
55
55
/// all identifiers in an environment must be unique (no shadowing).
56
56
pub parameter_map : ParameterMap ,
@@ -83,7 +83,7 @@ pub enum TypeLookup<'k> {
83
83
Opaque ( OpaqueTyId < ChalkIr > ) ,
84
84
Foreign ( ForeignDefId < ChalkIr > ) ,
85
85
Trait ( TraitId < ChalkIr > ) ,
86
- Generator ( GeneratorId < ChalkIr > ) ,
86
+ Coroutine ( CoroutineId < ChalkIr > ) ,
87
87
}
88
88
89
89
impl Env < ' _ > {
@@ -133,7 +133,7 @@ impl Env<'_> {
133
133
Ok ( TypeLookup :: Adt ( id) ) => tykind ! ( self . adt_kind( id) , Adt , id) ,
134
134
Ok ( TypeLookup :: FnDef ( id) ) => tykind ! ( self . fn_def_kind( id) , FnDef , id) ,
135
135
Ok ( TypeLookup :: Closure ( id) ) => tykind ! ( self . closure_kind( id) , Closure , id) ,
136
- Ok ( TypeLookup :: Generator ( id) ) => tykind ! ( self . generator_kind ( id) , Generator , id) ,
136
+ Ok ( TypeLookup :: Coroutine ( id) ) => tykind ! ( self . coroutine_kind ( id) , Coroutine , id) ,
137
137
Ok ( TypeLookup :: Opaque ( id) ) => Ok ( chalk_ir:: TyKind :: Alias ( chalk_ir:: AliasTy :: Opaque (
138
138
chalk_ir:: OpaqueTy {
139
139
opaque_ty_id : id,
@@ -165,8 +165,8 @@ impl Env<'_> {
165
165
Ok ( TypeLookup :: Foreign ( * id) )
166
166
} else if let Some ( id) = self . trait_ids . get ( & name. str ) {
167
167
Ok ( TypeLookup :: Trait ( * id) )
168
- } else if let Some ( id) = self . generator_ids . get ( & name. str ) {
169
- Ok ( TypeLookup :: Generator ( * id) )
168
+ } else if let Some ( id) = self . coroutine_ids . get ( & name. str ) {
169
+ Ok ( TypeLookup :: Coroutine ( * id) )
170
170
} else {
171
171
Err ( RustIrError :: NotStruct ( name. clone ( ) ) )
172
172
}
@@ -208,8 +208,8 @@ impl Env<'_> {
208
208
& self . opaque_ty_kinds [ & id]
209
209
}
210
210
211
- pub fn generator_kind ( & self , id : chalk_ir:: GeneratorId < ChalkIr > ) -> & TypeKind {
212
- & self . generator_kinds [ & id]
211
+ pub fn coroutine_kind ( & self , id : chalk_ir:: CoroutineId < ChalkIr > ) -> & TypeKind {
212
+ & self . coroutine_kinds [ & id]
213
213
}
214
214
215
215
pub fn lookup_associated_ty (
0 commit comments