diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2024-01-10 22:18:48 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2024-01-15 16:52:51 +0100 |
| commit | 2ad780eaf03816ae26cd4285eb379e2bb0c55672 (patch) | |
| tree | 17dc3a6425de31213a9806e7b8d29651af7d4dc2 | |
| parent | 1ead4761e9e2f056385768614c23ffa7acb6a19e (diff) | |
| download | rust-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.rs | 3 |
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, .. } => { |
