We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
map_or
1 parent 8eae198 commit 7592c13Copy full SHA for 7592c13
compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs
@@ -140,19 +140,19 @@ impl<'tcx> InherentOverlapChecker<'tcx> {
140
impl1_def_id: DefId,
141
impl2_def_id: DefId,
142
) {
143
- traits::overlapping_impls(
+ let maybe_overlap = traits::overlapping_impls(
144
self.tcx,
145
impl1_def_id,
146
impl2_def_id,
147
// We go ahead and just skip the leak check for
148
// inherent impls without warning.
149
SkipLeakCheck::Yes,
150
overlap_mode,
151
- )
152
- .map_or(true, |overlap| {
+ );
+
153
+ if let Some(overlap) = maybe_overlap {
154
self.check_for_common_items_in_impls(impl1_def_id, impl2_def_id, overlap);
- false
155
- });
+ }
156
}
157
158
fn check_item(&mut self, id: hir::ItemId) {
0 commit comments