Skip to content

Commit 9f609f9

Browse files
committed
Fix Ref inhabitedness comment
1 parent 64c2a31 commit 9f609f9

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
@@ -1574,10 +1574,9 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
15741574
}
15751575
}
15761576
ty::Ref(..) => {
1577-
// Though references to uninhabited types are trivially uninhabited
1578-
// theoretically, null references are permitted in unsafe code (as
1579-
// long as the value is not dereferenced), so we treat all references
1580-
// as inhabited.
1577+
// References to uninitialised memory is valid for any type, including
1578+
// uninhabited types, in unsafe code, so we treat all references as
1579+
// inhabited.
15811580
false
15821581
}
15831582
_ => false,

0 commit comments

Comments
 (0)