1
Fork 0

rustc_trait_selection: adopt let else in more places

This commit is contained in:
est31 2022-02-19 00:48:31 +01:00
parent b8c56fa8c3
commit dab5c44800
10 changed files with 75 additions and 117 deletions

View file

@ -1832,9 +1832,8 @@ fn confirm_impl_candidate<'cx, 'tcx>(
let trait_def_id = tcx.trait_id_of_impl(impl_def_id).unwrap();
let param_env = obligation.param_env;
let assoc_ty = match assoc_def(selcx, impl_def_id, assoc_item_id) {
Ok(assoc_ty) => assoc_ty,
Err(ErrorReported) => return Progress { term: tcx.ty_error().into(), obligations: nested },
let Ok(assoc_ty) = assoc_def(selcx, impl_def_id, assoc_item_id) else {
return Progress { term: tcx.ty_error().into(), obligations: nested };
};
if !assoc_ty.item.defaultness.has_value() {