about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2024-01-10 22:18:48 +0100
committerNadrieril <nadrieril+git@gmail.com>2024-01-15 16:52:51 +0100
commit2ad780eaf03816ae26cd4285eb379e2bb0c55672 (patch)
tree17dc3a6425de31213a9806e7b8d29651af7d4dc2
parent1ead4761e9e2f056385768614c23ffa7acb6a19e (diff)
downloadrust-2ad780eaf03816ae26cd4285eb379e2bb0c55672.tar.gz
rust-2ad780eaf03816ae26cd4285eb379e2bb0c55672.zip
Clarify that the status of `&!` is undecided
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/check_match.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
index f6c5e4a5cd6..1b7be98600f 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
@@ -289,7 +289,8 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> {
     fn is_known_valid_scrutinee(&self, scrutinee: &Expr<'tcx>) -> bool {
         use ExprKind::*;
         match &scrutinee.kind {
-            // Both pointers and references can validly point to a place with invalid data.
+            // Pointers can validly point to a place with invalid data. It is undecided whether
+            // references can too, so we conservatively assume they can.
             Deref { .. } => false,
             // Inherit validity of the parent place, unless the parent is an union.
             Field { lhs, .. } => {