Skip to content

Commit 47e34a2

Browse files
committed
Fix Ref inhabitedness comment
1 parent 55d2607 commit 47e34a2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustc/ty/sty.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,10 +1535,9 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
15351535
}
15361536
}
15371537
ty::Ref(..) => {
1538-
// Though references to uninhabited types are trivially uninhabited
1539-
// theoretically, null references are permitted in unsafe code (as
1540-
// long as the value is not dereferenced), so we treat all references
1541-
// as inhabited.
1538+
// References to uninitialised memory is valid for any type, including
1539+
// uninhabited types, in unsafe code, so we treat all references as
1540+
// inhabited.
15421541
false
15431542
}
15441543
_ => false,

0 commit comments

Comments
 (0)