From 13af92f4592debacd3df601e380f35faec64e63f Mon Sep 17 00:00:00 2001 From: varkor Date: Tue, 23 Oct 2018 19:13:49 +0100 Subject: [PATCH] Add note on nonzero-sized uninhabited types --- src/librustc/ty/sty.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 3dab7f4dd77..8381101290e 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -1547,7 +1547,8 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> { /// conservative: for some types that are uninhabited we return `false`, /// but we only return `true` for types that are definitely uninhabited. /// `ty.conservative_is_uninhabited` implies that any value of type `ty` - /// will be `Abi::Uninhabited`. + /// will be `Abi::Uninhabited`. (Note that uninhabited types may have nonzero + /// size, to account for partial initialisation. See #49298 for details.) pub fn conservative_is_uninhabited(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> bool { // FIXME(varkor): we can make this less conversative by substituting concrete // type arguments.