@@ -292,8 +292,6 @@ pub(super) fn check_item<'tcx>(
292
292
hir:: ItemKind :: Struct ( ..) => check_type_defn ( tcx, item, false ) ,
293
293
hir:: ItemKind :: Union ( ..) => check_type_defn ( tcx, item, true ) ,
294
294
hir:: ItemKind :: Enum ( ..) => check_type_defn ( tcx, item, true ) ,
295
- hir:: ItemKind :: Trait ( ..) => check_trait ( tcx, item) ,
296
- hir:: ItemKind :: TraitAlias ( ..) => check_trait ( tcx, item) ,
297
295
_ => Ok ( ( ) ) ,
298
296
}
299
297
}
@@ -344,7 +342,7 @@ pub(crate) fn check_trait_item<'tcx>(
344
342
/// fn into_iter<'a>(&'a self) -> Self::Iter<'a>;
345
343
/// }
346
344
/// ```
347
- fn check_gat_where_clauses ( tcx : TyCtxt < ' _ > , trait_def_id : LocalDefId ) {
345
+ pub ( crate ) fn check_gat_where_clauses ( tcx : TyCtxt < ' _ > , trait_def_id : LocalDefId ) {
348
346
// Associates every GAT's def_id to a list of possibly missing bounds detected by this lint.
349
347
let mut required_bounds_by_item = FxIndexMap :: default ( ) ;
350
348
let associated_items = tcx. associated_items ( trait_def_id) ;
@@ -1105,11 +1103,8 @@ fn check_type_defn<'tcx>(
1105
1103
} )
1106
1104
}
1107
1105
1108
- #[ instrument( skip( tcx, item) ) ]
1109
- fn check_trait ( tcx : TyCtxt < ' _ > , item : & hir:: Item < ' _ > ) -> Result < ( ) , ErrorGuaranteed > {
1110
- debug ! ( ?item. owner_id) ;
1111
-
1112
- let def_id = item. owner_id . def_id ;
1106
+ #[ instrument( skip( tcx) ) ]
1107
+ pub ( crate ) fn check_trait ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) -> Result < ( ) , ErrorGuaranteed > {
1113
1108
if tcx. is_lang_item ( def_id. into ( ) , LangItem :: PointeeSized ) {
1114
1109
// `PointeeSized` is removed during lowering.
1115
1110
return Ok ( ( ) ) ;
@@ -1135,10 +1130,6 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) -> Result<(), ErrorGuarant
1135
1130
Ok ( ( ) )
1136
1131
} ) ;
1137
1132
1138
- // Only check traits, don't check trait aliases
1139
- if let hir:: ItemKind :: Trait ( ..) = item. kind {
1140
- check_gat_where_clauses ( tcx, item. owner_id . def_id ) ;
1141
- }
1142
1133
res
1143
1134
}
1144
1135
0 commit comments