about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-10-23 19:13:49 +0100
committervarkor <github@varkor.com>2018-12-11 11:18:55 +0000
commit13af92f4592debacd3df601e380f35faec64e63f (patch)
tree2bb75464b90fb0164989a3f97f467a7440d7e8fd /src
parenta38ff377e7420d33fb67349fdcda3fe9fde329d1 (diff)
downloadrust-13af92f4592debacd3df601e380f35faec64e63f.tar.gz
rust-13af92f4592debacd3df601e380f35faec64e63f.zip
Add note on nonzero-sized uninhabited types
Diffstat (limited to 'src')
-rw-r--r--src/librustc/ty/sty.rs3
1 files changed, 2 insertions, 1 deletions
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.