@@ -74,6 +74,13 @@ impl LangItemTarget {
7474 _ => None ,
7575 }
7676 }
77+
78+ pub fn as_type_alias ( self ) -> Option < TypeAliasId > {
79+ match self {
80+ LangItemTarget :: TypeAlias ( id) => Some ( id) ,
81+ _ => None ,
82+ }
83+ }
7784}
7885
7986#[ derive( Default , Debug , Clone , PartialEq , Eq ) ]
@@ -117,11 +124,19 @@ impl LangItems {
117124 match def {
118125 ModuleDefId :: TraitId ( trait_) => {
119126 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+ ) ;
125140 }
126141 ModuleDefId :: AdtId ( AdtId :: EnumId ( e) ) => {
127142 lang_items. collect_lang_item ( db, e, LangItemTarget :: EnumId ) ;
@@ -453,6 +468,7 @@ language_item_table! {
453468
454469 Context , sym:: Context , context, Target :: Struct , GenericRequirement :: None ;
455470 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 ;
456472
457473 Option , sym:: Option , option_type, Target :: Enum , GenericRequirement :: None ;
458474 OptionSome , sym:: Some , option_some_variant, Target :: Variant , GenericRequirement :: None ;
@@ -467,6 +483,7 @@ language_item_table! {
467483 IntoFutureIntoFuture , sym:: into_future, into_future_fn, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
468484 IntoIterIntoIter , sym:: into_iter, into_iter_fn, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
469485 IteratorNext , sym:: next, next_fn, Target :: Method ( MethodKind :: Trait { body: false } ) , GenericRequirement :: None ;
486+ Iterator , sym:: iterator, iterator, Target :: Trait , GenericRequirement :: None ;
470487
471488 PinNewUnchecked , sym:: new_unchecked, new_unchecked_fn, Target :: Method ( MethodKind :: Inherent ) , GenericRequirement :: None ;
472489
0 commit comments