Skip to content

Commit 799e0f7

Browse files
committed
add FIXMEs for diagnostic improvements
1 parent 2c595d6 commit 799e0f7

File tree

1 file changed

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

1 file changed

+8
-0
lines changed

compiler/rustc_hir_typeck/src/pat.rs

+8
Original file line numberDiff line numberDiff line change
@@ -2384,6 +2384,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
23842384
// NB: This assumes that `&` patterns can match against mutable
23852385
// references (RFC 3627, Rule 5). If we implement a pattern typing
23862386
// ruleset with Rule 4 but not Rule 5, we'll need to check that here.
2387+
// FIXME(ref_pat_eat_one_layer_2024_structural): If we already tried
2388+
// matching the real reference, the error message should explain that
2389+
// falling back to the inherited reference didn't work. This should be
2390+
// the same error as the old-Edition version below.
23872391
debug_assert!(ref_pat_matches_mut_ref);
23882392
self.error_inherited_ref_mutability_mismatch(pat, pat_prefix_span);
23892393
}
@@ -2418,6 +2422,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
24182422
} else {
24192423
// Otherwise, use the common logic below for matching the inner
24202424
// reference type.
2425+
// FIXME(ref_pat_eat_one_layer_2024_structural): If this results in a
2426+
// mutability mismatch, the error message should explain that falling
2427+
// back to the inherited reference didn't work. This should be the same
2428+
// error as the Edition 2024 version above.
24212429
}
24222430
} else {
24232431
// The expected type isn't a reference type, so only match against the

0 commit comments

Comments
 (0)