@@ -194,12 +194,13 @@ pub fn check_trait_item(tcx: TyCtxt<'_>, def_id: LocalDefId) {
194194 let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id) ;
195195 let trait_item = tcx. hir ( ) . expect_trait_item ( hir_id) ;
196196
197- let method_sig = match trait_item. kind {
198- hir:: TraitItemKind :: Fn ( ref sig, _) => Some ( sig) ,
199- _ => None ,
197+ let ( method_sig, span) = match trait_item. kind {
198+ hir:: TraitItemKind :: Fn ( ref sig, _) => ( Some ( sig) , trait_item. span ) ,
199+ hir:: TraitItemKind :: Type ( _bounds, Some ( ty) ) => ( None , ty. span ) ,
200+ _ => ( None , trait_item. span ) ,
200201 } ;
201202 check_object_unsafe_self_trait_by_name ( tcx, & trait_item) ;
202- check_associated_item ( tcx, trait_item. hir_id ( ) , trait_item . span , method_sig) ;
203+ check_associated_item ( tcx, trait_item. hir_id ( ) , span, method_sig) ;
203204}
204205
205206fn could_be_self ( trait_def_id : LocalDefId , ty : & hir:: Ty < ' _ > ) -> bool {
@@ -268,12 +269,13 @@ pub fn check_impl_item(tcx: TyCtxt<'_>, def_id: LocalDefId) {
268269 let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id) ;
269270 let impl_item = tcx. hir ( ) . expect_impl_item ( hir_id) ;
270271
271- let method_sig = match impl_item. kind {
272- hir:: ImplItemKind :: Fn ( ref sig, _) => Some ( sig) ,
273- _ => None ,
272+ let ( method_sig, span) = match impl_item. kind {
273+ hir:: ImplItemKind :: Fn ( ref sig, _) => ( Some ( sig) , impl_item. span ) ,
274+ hir:: ImplItemKind :: TyAlias ( ty) => ( None , ty. span ) ,
275+ _ => ( None , impl_item. span ) ,
274276 } ;
275277
276- check_associated_item ( tcx, impl_item. hir_id ( ) , impl_item . span , method_sig) ;
278+ check_associated_item ( tcx, impl_item. hir_id ( ) , span, method_sig) ;
277279}
278280
279281fn check_param_wf ( tcx : TyCtxt < ' _ > , param : & hir:: GenericParam < ' _ > ) {
0 commit comments