Clarify that the status of &!
is undecided
This commit is contained in:
parent
1ead4761e9
commit
2ad780eaf0
1 changed files with 2 additions and 1 deletions
|
@ -289,7 +289,8 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> {
|
||||||
fn is_known_valid_scrutinee(&self, scrutinee: &Expr<'tcx>) -> bool {
|
fn is_known_valid_scrutinee(&self, scrutinee: &Expr<'tcx>) -> bool {
|
||||||
use ExprKind::*;
|
use ExprKind::*;
|
||||||
match &scrutinee.kind {
|
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,
|
Deref { .. } => false,
|
||||||
// Inherit validity of the parent place, unless the parent is an union.
|
// Inherit validity of the parent place, unless the parent is an union.
|
||||||
Field { lhs, .. } => {
|
Field { lhs, .. } => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue