Skip to content

Commit ee66acb

Browse files
author
Lukas Markeffsky
committed
use a let chain
1 parent 8fe99f5 commit ee66acb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
2020
// such cases.
2121
if let ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_ref)) =
2222
key.value.predicate.kind().skip_binder()
23+
&& let Some(sized_def_id) = tcx.lang_items().sized_trait()
24+
&& trait_ref.def_id() == sized_def_id
25+
&& trait_ref.self_ty().is_trivially_sized(tcx)
2326
{
24-
if let Some(sized_def_id) = tcx.lang_items().sized_trait() {
25-
if trait_ref.def_id() == sized_def_id {
26-
if trait_ref.self_ty().is_trivially_sized(tcx) {
27-
return Some(());
28-
}
29-
}
30-
}
27+
return Some(());
3128
}
3229

3330
if let ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) =

0 commit comments

Comments
 (0)