about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2024-03-13 23:51:48 +0100
committerLukas Markeffsky <@>2024-03-14 21:28:48 +0100
commitee66acbea856f12694ea7c8033769a371a754ae3 (patch)
treedf243bae8979d04f5d109a42d7ae3261f2cb818d
parent8fe99f57a42fe2a2f5ed19d3b6c3a7b2b5455edd (diff)
downloadrust-ee66acbea856f12694ea7c8033769a371a754ae3.tar.gz
rust-ee66acbea856f12694ea7c8033769a371a754ae3.zip
use a let chain
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs
index 14f14ae6e2e..63289746f5e 100644
--- a/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs
@@ -20,14 +20,11 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
         // such cases.
         if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_ref)) =
             key.value.predicate.kind().skip_binder()
+            && let Some(sized_def_id) = tcx.lang_items().sized_trait()
+            && trait_ref.def_id() == sized_def_id
+            && trait_ref.self_ty().is_trivially_sized(tcx)
         {
-            if let Some(sized_def_id) = tcx.lang_items().sized_trait() {
-                if trait_ref.def_id() == sized_def_id {
-                    if trait_ref.self_ty().is_trivially_sized(tcx) {
-                        return Some(());
-                    }
-                }
-            }
+            return Some(());
         }
 
         if let ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) =