Make overlapping_impls non-generic

This improves perf
This commit is contained in:
Cameron Steffen 2022-10-11 15:37:11 -05:00
parent 6b3ede3f7b
commit c4068c76a8
3 changed files with 34 additions and 47 deletions

View file

@ -117,12 +117,11 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
// inherent impls without warning.
SkipLeakCheck::Yes,
overlap_mode,
|overlap| {
self.check_for_common_items_in_impls(impl1_def_id, impl2_def_id, overlap);
false
},
|| true,
);
)
.map_or(true, |overlap| {
self.check_for_common_items_in_impls(impl1_def_id, impl2_def_id, overlap);
false
});
}
fn check_item(&mut self, id: hir::ItemId) {