about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-09 11:21:59 +0100
committerGitHub <noreply@github.com>2023-02-09 11:21:59 +0100
commitf2a2e298bafd113fc277ce6fc53df340f55c3cd0 (patch)
tree3c13a999562eee41ed85e413270c4e7f6a78c8ef
parenta8df4b15302ebb452369797439470b135d6736d2 (diff)
parentb651679d90bf3ed6f22c4fed53d330cf416eaf09 (diff)
downloadrust-f2a2e298bafd113fc277ce6fc53df340f55c3cd0.tar.gz
rust-f2a2e298bafd113fc277ce6fc53df340f55c3cd0.zip
Rollup merge of #107835 - tshepang:fmt, r=WaffleLapkin
use idiomatic formatting

Also, remove needless `else`
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs25
1 files changed, 13 insertions, 12 deletions
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs
index db1acb59927..b220a87bc65 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs
@@ -802,18 +802,19 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         let mut walk = ty.walk();
         while let Some(arg) = walk.next() {
             if arg == param_to_point_at {
-            return true;
-        } else if let ty::GenericArgKind::Type(ty) = arg.unpack()
-            && let ty::Alias(ty::Projection, ..) = ty.kind()
-        {
-            // This logic may seem a bit strange, but typically when
-            // we have a projection type in a function signature, the
-            // argument that's being passed into that signature is
-            // not actually constraining that projection's substs in
-            // a meaningful way. So we skip it, and see improvements
-            // in some UI tests.
-            walk.skip_current_subtree();
-        }
+                return true;
+            }
+            if let ty::GenericArgKind::Type(ty) = arg.unpack()
+                && let ty::Alias(ty::Projection, ..) = ty.kind()
+            {
+                // This logic may seem a bit strange, but typically when
+                // we have a projection type in a function signature, the
+                // argument that's being passed into that signature is
+                // not actually constraining that projection's substs in
+                // a meaningful way. So we skip it, and see improvements
+                // in some UI tests.
+                walk.skip_current_subtree();
+            }
         }
         false
     }