Don't create the array type twice

This commit is contained in:
Oli Scherer 2024-01-15 15:49:58 +00:00
parent 1ead4761e9
commit 9a8f117d7b

View File

@ -1526,13 +1526,11 @@ fn check_expr_repeat(
self.check_repeat_element_needs_copy_bound(element, count, element_ty);
self.register_wf_obligation(
Ty::new_array_with_const_len(tcx, t, count).into(),
expr.span,
traits::WellFormed(None),
);
let ty = Ty::new_array_with_const_len(tcx, t, count);
Ty::new_array_with_const_len(tcx, t, count)
self.register_wf_obligation(ty.into(), expr.span, traits::WellFormed(None));
ty
}
fn check_repeat_element_needs_copy_bound(