diff options
| author | dianne <diannes.gm@gmail.com> | 2025-01-30 16:03:02 -0800 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-02-18 18:00:17 -0800 |
| commit | 799e0f76903f694632db29bf7fc38c8a7f1453b6 (patch) | |
| tree | 8b28b74582f9ffd6222a403f9fa9573c38f73f13 | |
| parent | 2c595d649aa3ca7cb07ddbbd07ec38a753d6a70d (diff) | |
| download | rust-799e0f76903f694632db29bf7fc38c8a7f1453b6.tar.gz rust-799e0f76903f694632db29bf7fc38c8a7f1453b6.zip | |
add FIXMEs for diagnostic improvements
| -rw-r--r-- | compiler/rustc_hir_typeck/src/pat.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index be72af63fe5..1e28571807e 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -2384,6 +2384,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // NB: This assumes that `&` patterns can match against mutable // references (RFC 3627, Rule 5). If we implement a pattern typing // ruleset with Rule 4 but not Rule 5, we'll need to check that here. + // FIXME(ref_pat_eat_one_layer_2024_structural): If we already tried + // matching the real reference, the error message should explain that + // falling back to the inherited reference didn't work. This should be + // the same error as the old-Edition version below. debug_assert!(ref_pat_matches_mut_ref); self.error_inherited_ref_mutability_mismatch(pat, pat_prefix_span); } @@ -2418,6 +2422,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } else { // Otherwise, use the common logic below for matching the inner // reference type. + // FIXME(ref_pat_eat_one_layer_2024_structural): If this results in a + // mutability mismatch, the error message should explain that falling + // back to the inherited reference didn't work. This should be the same + // error as the Edition 2024 version above. } } else { // The expected type isn't a reference type, so only match against the |
