@@ -327,18 +327,24 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
327327 }
328328 SubSupConflict ( ref var_origin, ref sub_origin, sub, ref sup_origin, sup) => {
329329 debug ! ( "processing SubSupConflict sub: {:?} sup: {:?}" , sub, sup) ;
330- if let SubregionOrigin :: CompareImplMethodObligation { .. } = * sub_origin {
331- // As above, when comparing an impl method
332- // against a trait method, it is not helpful
333- // to suggest changes to the impl method.
334- } else if let SubregionOrigin :: CompareImplMethodObligation { .. } = * sup_origin {
335- // See above.
336- } else if let Some ( same_frs) = free_regions_from_same_fn ( self . tcx , sub, sup) {
337- origins. push (
338- ProcessedErrorOrigin :: VariableFailure (
339- var_origin. clone ( ) ) ) ;
340- append_to_same_regions ( & mut same_regions, & same_frs) ;
341- continue ;
330+ match ( sub_origin, sup_origin) {
331+ ( & SubregionOrigin :: CompareImplMethodObligation { .. } , _) => {
332+ // As above, when comparing an impl method
333+ // against a trait method, it is not helpful
334+ // to suggest changes to the impl method.
335+ }
336+ ( _, & SubregionOrigin :: CompareImplMethodObligation { .. } ) => {
337+ // See above.
338+ }
339+ _ => {
340+ if let Some ( same_frs) = free_regions_from_same_fn ( self . tcx , sub, sup) {
341+ origins. push (
342+ ProcessedErrorOrigin :: VariableFailure (
343+ var_origin. clone ( ) ) ) ;
344+ append_to_same_regions ( & mut same_regions, & same_frs) ;
345+ continue ;
346+ }
347+ }
342348 }
343349 }
344350 GenericBoundFailure ( ref origin, ref kind, region) => {
0 commit comments