Skip to content

Commit f912fda

Browse files
committed
Add note on nonzero-sized uninhabited types
1 parent aa0875a commit f912fda

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
@@ -1508,7 +1508,8 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
15081508
/// conservative: for some types that are uninhabited we return `false`,
15091509
/// but we only return `true` for types that are definitely uninhabited.
15101510
/// `ty.conservative_is_uninhabited` implies that any value of type `ty`
1511-
/// will be `Abi::Uninhabited`.
1511+
/// will be `Abi::Uninhabited`. (Note that uninhabited types may have nonzero
1512+
/// size, to account for partial initialisation. See #49298 for details.)
15121513
pub fn conservative_is_uninhabited(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> bool {
15131514
// FIXME(varkor): we can make this less conversative by substituting concrete
15141515
// type arguments.

0 commit comments

Comments
 (0)