Recursive types are always non-empty

This commit is contained in:
Andrew Cann 2016-09-15 01:41:45 +08:00
parent f1bdd4fae2
commit 5b20c6aec7

View file

@ -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()))