From f0d157f7a54f9da6fe0685ab20e2e7ea85e48904 Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Wed, 13 Mar 2024 23:51:48 +0100 Subject: [PATCH] use a let chain --- .../src/traits/query/type_op/prove_predicate.rs | 11 ++++------- 1 file 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 14f14ae6e2e01..63289746f5e5d 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)) =