Skip to content

Commit 4dccea4

Browse files
committed
Clarify that the status of &! is undecided
1 parent d8b44d2 commit 4dccea4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> {
287287
fn is_known_valid_scrutinee(&self, scrutinee: &Expr<'tcx>) -> bool {
288288
use ExprKind::*;
289289
match &scrutinee.kind {
290-
// Both pointers and references can validly point to a place with invalid data.
290+
// Pointers can validly point to a place with invalid data. It is undecided whether
291+
// references can too, so we conservatively assume they can.
291292
Deref { .. } => false,
292293
// Inherit validity of the parent place, unless the parent is an union.
293294
Field { lhs, .. } => {

0 commit comments

Comments
 (0)