Skip to content

Commit 96af415

Browse files
committed
try to structurally resolve before try_resolve_slice_ty_to_array_ty
1 parent 65f92a5 commit 96af415

File tree

1 file changed

+2
-0
lines changed
  • compiler/rustc_hir_typeck/src

1 file changed

+2
-0
lines changed

compiler/rustc_hir_typeck/src/pat.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
21142114
expected: Ty<'tcx>,
21152115
pat_info: PatInfo<'tcx, '_>,
21162116
) -> Ty<'tcx> {
2117+
let expected = self.try_structurally_resolve_type(span, expected);
2118+
21172119
// If the pattern is irrefutable and `expected` is an infer ty, we try to equate it
21182120
// to an array if the given pattern allows it. See issue #76342
21192121
if self.pat_is_irrefutable(pat_info.decl_origin) && expected.is_ty_var() {

0 commit comments

Comments
 (0)