Skip to content

Commit 29626d0

Browse files
committed
add FIXMEs for diagnostic improvements
1 parent a7ee4c1 commit 29626d0

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
@@ -2376,6 +2376,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
23762376
// NB: This assumes that `&` patterns can match against mutable
23772377
// references (RFC 3627, Rule 5). If we implement a pattern typing
23782378
// ruleset with Rule 4 but not Rule 5, we'll need to check that here.
2379+
// FIXME(ref_pat_eat_one_layer_2024_structural): If we already tried
2380+
// matching the real reference, the error message should explain that
2381+
// falling back to the inherited reference didn't work. This should be
2382+
// the same error as the old-Edition version below.
23792383
debug_assert!(ref_pat_matches_mut_ref);
23802384
self.error_inherited_ref_mutability_mismatch(pat, pat_prefix_span);
23812385
}
@@ -2410,6 +2414,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
24102414
} else {
24112415
// Otherwise, use the common logic below for matching the inner
24122416
// reference type.
2417+
// FIXME(ref_pat_eat_one_layer_2024_structural): If this results in a
2418+
// mutability mismatch, the error message should explain that falling
2419+
// back to the inherited reference didn't work. This should be the same
2420+
// error as the Edition 2024 version above.
24132421
}
24142422
} else {
24152423
// The expected type isn't a reference type, so only match against the

0 commit comments

Comments
 (0)