@@ -138,35 +138,44 @@ impl<'tcx> Children {
138138 } ;
139139
140140 let last_lint_mut = & mut last_lint;
141- let ( le, ge) = traits:: overlapping_impls (
142- tcx,
143- possible_sibling,
144- impl_def_id,
145- traits:: SkipLeakCheck :: Yes ,
146- overlap_mode,
147- )
148- . map_or ( Ok ( ( false , false ) ) , |overlap| {
149- if let Some ( overlap_kind) =
150- tcx. impls_are_allowed_to_overlap ( impl_def_id, possible_sibling)
151- {
152- match overlap_kind {
153- ty:: ImplOverlapKind :: Permitted { marker : _ } => { }
154- ty:: ImplOverlapKind :: FutureCompatOrderDepTraitObjects => {
155- * last_lint_mut = Some ( FutureCompatOverlapError {
156- error : create_overlap_error ( overlap) ,
157- kind : FutureCompatOverlapErrorKind :: OrderDepTraitObjects ,
158- } ) ;
141+
142+ let overlap_kind = tcx. impls_are_allowed_to_overlap ( impl_def_id, possible_sibling) ;
143+ let ( le, ge) = if let Some ( ty:: ImplOverlapKind :: Permitted { marker : _ } ) = overlap_kind
144+ {
145+ ( false , false )
146+ } else {
147+ traits:: overlapping_impls (
148+ tcx,
149+ possible_sibling,
150+ impl_def_id,
151+ traits:: SkipLeakCheck :: Yes ,
152+ overlap_mode,
153+ )
154+ . map_or ( Ok ( ( false , false ) ) , |overlap| {
155+ if let Some ( overlap_kind) = overlap_kind {
156+ match overlap_kind {
157+ ty:: ImplOverlapKind :: Permitted { marker : _ } => { }
158+ ty:: ImplOverlapKind :: FutureCompatOrderDepTraitObjects => {
159+ * last_lint_mut = Some ( FutureCompatOverlapError {
160+ error : create_overlap_error ( overlap) ,
161+ kind : FutureCompatOverlapErrorKind :: OrderDepTraitObjects ,
162+ } ) ;
163+ }
159164 }
160- }
161165
162- return Ok ( ( false , false ) ) ;
163- }
166+ return Ok ( ( false , false ) ) ;
167+ }
164168
165- let le = tcx. specializes ( ( impl_def_id, possible_sibling) ) ;
166- let ge = tcx. specializes ( ( possible_sibling, impl_def_id) ) ;
169+ let le = tcx. specializes ( ( impl_def_id, possible_sibling) ) ;
170+ let ge = tcx. specializes ( ( possible_sibling, impl_def_id) ) ;
167171
168- if le == ge { report_overlap_error ( overlap, last_lint_mut) } else { Ok ( ( le, ge) ) }
169- } ) ?;
172+ if le == ge {
173+ report_overlap_error ( overlap, last_lint_mut)
174+ } else {
175+ Ok ( ( le, ge) )
176+ }
177+ } ) ?
178+ } ;
170179
171180 if le && !ge {
172181 debug ! (
0 commit comments