Skip to content

Commit c8931b1

Browse files
committed
Clarify that the status of &! is undecided
1 parent d73bd3f commit c8931b1

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

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

0 commit comments

Comments
 (0)