@@ -74,6 +74,13 @@ impl LangItemTarget {
74
74
_ => None ,
75
75
}
76
76
}
77
+
78
+ pub fn as_type_alias ( self ) -> Option < TypeAliasId > {
79
+ match self {
80
+ LangItemTarget :: TypeAlias ( id) => Some ( id) ,
81
+ _ => None ,
82
+ }
83
+ }
77
84
}
78
85
79
86
#[ derive( Default , Debug , Clone , PartialEq , Eq ) ]
@@ -117,11 +124,19 @@ impl LangItems {
117
124
match def {
118
125
ModuleDefId :: TraitId ( trait_) => {
119
126
lang_items. collect_lang_item ( db, trait_, LangItemTarget :: Trait ) ;
120
- db. trait_data ( trait_) . items . iter ( ) . for_each ( |& ( _, assoc_id) | {
121
- if let AssocItemId :: FunctionId ( f) = assoc_id {
122
- lang_items. collect_lang_item ( db, f, LangItemTarget :: Function ) ;
123
- }
124
- } ) ;
127
+ db. trait_data ( trait_) . items . iter ( ) . for_each (
128
+ |& ( _, assoc_id) | match assoc_id {
129
+ AssocItemId :: FunctionId ( f) => {
130
+ lang_items. collect_lang_item ( db, f, LangItemTarget :: Function ) ;
131
+ }
132
+ AssocItemId :: TypeAliasId ( alias) => lang_items. collect_lang_item (
133
+ db,
134
+ alias,
135
+ LangItemTarget :: TypeAlias ,
136
+ ) ,
137
+ AssocItemId :: ConstId ( _) => { }
138
+ } ,
139
+ ) ;
125
140
}
126
141
ModuleDefId :: AdtId ( AdtId :: EnumId ( e) ) => {
127
142
lang_items. collect_lang_item ( db, e, LangItemTarget :: EnumId ) ;
@@ -453,6 +468,7 @@ language_item_table! {
453
468
454
469
Context , sym:: Context , context, Target :: Struct , GenericRequirement :: None ;
455
470
FuturePoll , sym:: poll, future_poll_fn, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
471
+ FutureOutput , sym:: future_output, future_output, Target :: TypeAlias , GenericRequirement :: None ;
456
472
457
473
Option , sym:: Option , option_type, Target :: Enum , GenericRequirement :: None ;
458
474
OptionSome , sym:: Some , option_some_variant, Target :: Variant , GenericRequirement :: None ;
@@ -467,6 +483,7 @@ language_item_table! {
467
483
IntoFutureIntoFuture , sym:: into_future, into_future_fn, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
468
484
IntoIterIntoIter , sym:: into_iter, into_iter_fn, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
469
485
IteratorNext , sym:: next, next_fn, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
486
+ Iterator , sym:: iterator, iterator, Target :: Trait , GenericRequirement :: None ;
470
487
471
488
PinNewUnchecked , sym:: new_unchecked, new_unchecked_fn, Target :: Method ( MethodKind :: Inherent ) , GenericRequirement :: None ;
472
489
0 commit comments