about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-09-20 20:22:02 +0100
committervarkor <github@varkor.com>2018-12-11 11:18:55 +0000
commit9f609f9feff30324a2fc99ed0f25010d64205dd6 (patch)
treeac5d50630f01b9d25ca204f68e0ae9e5e3534a9e /src
parent64c2a310e1bb489a97e6e8624201b632e31de5aa (diff)
downloadrust-9f609f9feff30324a2fc99ed0f25010d64205dd6.tar.gz
rust-9f609f9feff30324a2fc99ed0f25010d64205dd6.zip
Fix Ref inhabitedness comment
Diffstat (limited to 'src')
-rw-r--r--src/librustc/ty/sty.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs
index 46f22fa86a6..0c859dea8da 100644
--- a/src/librustc/ty/sty.rs
+++ b/src/librustc/ty/sty.rs
@@ -1574,10 +1574,9 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
                 }
             }
             ty::Ref(..) => {
-                // Though references to uninhabited types are trivially uninhabited
-                // theoretically, null references are permitted in unsafe code (as
-                // long as the value is not dereferenced), so we treat all references
-                // as inhabited.
+                // References to uninitialised memory is valid for any type, including
+                // uninhabited types, in unsafe code, so we treat all references as
+                // inhabited.
                 false
             }
             _ => false,