Skip to content

Commit 541bd2c

Browse files
committed
Fix Ref inhabitedness comment
1 parent 0444843 commit 541bd2c

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
@@ -1520,10 +1520,9 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
15201520
}
15211521
}
15221522
ty::Ref(..) => {
1523-
// Though references to uninhabited types are trivially uninhabited
1524-
// theoretically, null references are permitted in unsafe code (as
1525-
// long as the value is not dereferenced), so we treat all references
1526-
// as inhabited.
1523+
// References to uninitialised memory is valid for any type, including
1524+
// uninhabited types, in unsafe code, so we treat all references as
1525+
// inhabited.
15271526
false
15281527
}
15291528
_ => false,

0 commit comments

Comments
 (0)