From 9f609f9feff30324a2fc99ed0f25010d64205dd6 Mon Sep 17 00:00:00 2001 From: varkor Date: Thu, 20 Sep 2018 20:22:02 +0100 Subject: [PATCH] Fix Ref inhabitedness comment --- src/librustc/ty/sty.rs | 7 +++---- 1 file 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,