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