@@ -194,12 +194,13 @@ pub fn check_trait_item(tcx: TyCtxt<'_>, def_id: LocalDefId) {
194
194
let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id) ;
195
195
let trait_item = tcx. hir ( ) . expect_trait_item ( hir_id) ;
196
196
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 ) ,
200
201
} ;
201
202
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) ;
203
204
}
204
205
205
206
fn 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) {
268
269
let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id) ;
269
270
let impl_item = tcx. hir ( ) . expect_impl_item ( hir_id) ;
270
271
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 ) ,
274
276
} ;
275
277
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) ;
277
279
}
278
280
279
281
fn check_param_wf ( tcx : TyCtxt < ' _ > , param : & hir:: GenericParam < ' _ > ) {
0 commit comments