From 5b20c6aec716abd1b1e8cd8750ae0d106db5f616 Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Thu, 15 Sep 2016 01:41:45 +0800 Subject: [PATCH] Recursive types are always non-empty --- src/librustc/ty/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 68440a2c8d85..f4a908764185 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -1397,7 +1397,7 @@ impl<'a, 'gcx, 'tcx> AdtDefData<'tcx, 'static> { cx: TyCtxt<'a, 'gcx, 'tcx>, substs: &'tcx Substs<'tcx>) -> bool { match visited.entry((self.did, substs)) { - hash_map::Entry::Occupied(_) => return true, + hash_map::Entry::Occupied(_) => return false, hash_map::Entry::Vacant(ve) => ve.insert(()), }; self.variants.iter().all(|v| v.is_uninhabited_recurse(visited, cx, substs, self.is_union()))