diff options
| author | Andrew Cann <shum@canndrew.org> | 2016-09-13 16:30:57 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2016-11-22 13:21:21 +0800 |
| commit | 69bb5fa85203e264387806bbb05acaffb1e95559 (patch) | |
| tree | d62d18d085660fde7088b85211e2e7ec8bc3ea63 | |
| parent | 82d8833a456a408fe8b761a3b5e88475b65066c8 (diff) | |
| download | rust-69bb5fa85203e264387806bbb05acaffb1e95559.tar.gz rust-69bb5fa85203e264387806bbb05acaffb1e95559.zip | |
Expand is_uninhabited for ! and tuples
| -rw-r--r-- | src/librustc/ty/sty.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 81896ecfb53..af45a323eee 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -929,16 +929,14 @@ 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 { TyAdt(def, _) => def.is_empty(), - // FIXME(canndrew): There's no reason why these can't be uncommented, they're tested - // and they don't break anything. But I'm keeping my changes small for now. - //TyNever => true, - //TyTuple(ref tys) => tys.iter().any(|ty| ty.is_uninhabited(cx)), + TyNever => true, + 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), |
