Skip to content

Commit

Permalink
Replace a bool with a Result<(), ErrorGuaranteed>
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jun 12, 2024
1 parent f620d96 commit c84615c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_hir_typeck/src/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
subpats,
&variant.fields.raw,
expected,
had_err.is_err(),
had_err,
);
on_error(e);
return Ty::new_error(tcx, e);
Expand All @@ -1272,7 +1272,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
subpats: &'tcx [Pat<'tcx>],
fields: &'tcx [ty::FieldDef],
expected: Ty<'tcx>,
had_err: bool,
had_err: Result<(), ErrorGuaranteed>,
) -> ErrorGuaranteed {
let subpats_ending = pluralize!(subpats.len());
let fields_ending = pluralize!(fields.len());
Expand Down Expand Up @@ -1329,7 +1329,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// #67037: only do this if we could successfully type-check the expected type against
// the tuple struct pattern. Otherwise the args could get out of range on e.g.,
// `let P() = U;` where `P != U` with `struct P<T>(T);`.
(ty::Adt(_, args), [field], false) => {
(ty::Adt(_, args), [field], Ok(())) => {
let field_ty = self.field_ty(pat_span, field, args);
match field_ty.kind() {
ty::Tuple(fields) => fields.len() == subpats.len(),
Expand Down

0 comments on commit c84615c

Please sign in to comment.