Skip to content

Commit 69bb5fa

Browse files
committed
Expand is_uninhabited for ! and tuples
1 parent 82d8833 commit 69bb5fa

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/librustc/ty/sty.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -929,16 +929,14 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
929929
}
930930
}
931931

932-
pub fn is_uninhabited(&self, _cx: TyCtxt) -> bool {
932+
pub fn is_uninhabited(&self, cx: TyCtxt) -> bool {
933933
// FIXME(#24885): be smarter here, the AdtDefData::is_empty method could easily be made
934934
// more complete.
935935
match self.sty {
936936
TyAdt(def, _) => def.is_empty(),
937937

938-
// FIXME(canndrew): There's no reason why these can't be uncommented, they're tested
939-
// and they don't break anything. But I'm keeping my changes small for now.
940-
//TyNever => true,
941-
//TyTuple(ref tys) => tys.iter().any(|ty| ty.is_uninhabited(cx)),
938+
TyNever => true,
939+
TyTuple(ref tys) => tys.iter().any(|ty| ty.is_uninhabited(cx)),
942940

943941
// FIXME(canndrew): this line breaks core::fmt
944942
//TyRef(_, ref tm) => tm.ty.is_uninhabited(cx),

0 commit comments

Comments
 (0)