From 80103141908f7c96ae1c4e2efa8763212a2399d8 Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Tue, 2 Aug 2016 16:08:12 +0800 Subject: [PATCH] Un-improve Ty::is_uninabited --- src/librustc/ty/sty.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 8d9bd7a58af..d52208c05d5 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -901,14 +901,18 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> { } } - pub fn is_uninhabited(&self, cx: TyCtxt) -> bool { + pub fn is_uninhabited(&self, _cx: TyCtxt) -> bool { // FIXME(#24885): be smarter here, the AdtDefData::is_empty method could easily be made // more complete. match self.sty { TyEnum(def, _) | TyStruct(def, _) => def.is_empty(), TyNever => true, - TyTuple(ref tys) => tys.iter().any(|ty| ty.is_uninhabited(cx)), - // FIXME (canndrew): this line breaks core::fmt + + // FIXME(canndrew): There's no reason why this can't be uncommented, it's tested and it + // doesn't break anything. But I'm keeping my changes small for now. + //TyTuple(ref tys) => tys.iter().any(|ty| ty.is_uninhabited(cx)), + + // FIXME(canndrew): this line breaks core::fmt //TyRef(_, ref tm) => tm.ty.is_uninhabited(cx), _ => false, }