Skip to content

Commit 13af92f

Browse files
committed
Add note on nonzero-sized uninhabited types
1 parent a38ff37 commit 13af92f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc/ty/sty.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,8 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
15471547
/// conservative: for some types that are uninhabited we return `false`,
15481548
/// but we only return `true` for types that are definitely uninhabited.
15491549
/// `ty.conservative_is_uninhabited` implies that any value of type `ty`
1550-
/// will be `Abi::Uninhabited`.
1550+
/// will be `Abi::Uninhabited`. (Note that uninhabited types may have nonzero
1551+
/// size, to account for partial initialisation. See #49298 for details.)
15511552
pub fn conservative_is_uninhabited(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> bool {
15521553
// FIXME(varkor): we can make this less conversative by substituting concrete
15531554
// type arguments.

0 commit comments

Comments
 (0)