Skip to content

Commit 7566307

Browse files
committed
Replace a bool with a Result<(), ErrorGuaranteed>
1 parent e8d6170 commit 7566307

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+3
-3
lines changed

compiler/rustc_hir_typeck/src/pat.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12561256
subpats,
12571257
&variant.fields.raw,
12581258
expected,
1259-
had_err.is_err(),
1259+
had_err,
12601260
);
12611261
on_error(e);
12621262
return Ty::new_error(tcx, e);
@@ -1272,7 +1272,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12721272
subpats: &'tcx [Pat<'tcx>],
12731273
fields: &'tcx [ty::FieldDef],
12741274
expected: Ty<'tcx>,
1275-
had_err: bool,
1275+
had_err: Result<(), ErrorGuaranteed>,
12761276
) -> ErrorGuaranteed {
12771277
let subpats_ending = pluralize!(subpats.len());
12781278
let fields_ending = pluralize!(fields.len());
@@ -1329,7 +1329,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13291329
// #67037: only do this if we could successfully type-check the expected type against
13301330
// the tuple struct pattern. Otherwise the args could get out of range on e.g.,
13311331
// `let P() = U;` where `P != U` with `struct P<T>(T);`.
1332-
(ty::Adt(_, args), [field], false) => {
1332+
(ty::Adt(_, args), [field], Ok(())) => {
13331333
let field_ty = self.field_ty(pat_span, field, args);
13341334
match field_ty.kind() {
13351335
ty::Tuple(fields) => fields.len() == subpats.len(),

0 commit comments

Comments
 (0)