diff options
| author | Lukas Markeffsky <@> | 2024-03-13 23:51:48 +0100 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2024-03-14 21:28:48 +0100 |
| commit | ee66acbea856f12694ea7c8033769a371a754ae3 (patch) | |
| tree | df243bae8979d04f5d109a42d7ae3261f2cb818d | |
| parent | 8fe99f57a42fe2a2f5ed19d3b6c3a7b2b5455edd (diff) | |
| download | rust-ee66acbea856f12694ea7c8033769a371a754ae3.tar.gz rust-ee66acbea856f12694ea7c8033769a371a754ae3.zip | |
use a let chain
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs | 11 |
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)) = |
