@@ -16,7 +16,6 @@ pub use self::IntVarValue::*;
16
16
pub use self :: LvaluePreference :: * ;
17
17
pub use self :: fold:: TypeFoldable ;
18
18
19
- use std:: collections:: { hash_map, HashMap } ;
20
19
use dep_graph:: { self , DepNode } ;
21
20
use hir:: map as ast_map;
22
21
use middle;
@@ -31,7 +30,7 @@ use ty::subst::{Subst, Substs};
31
30
use ty:: walk:: TypeWalker ;
32
31
use util:: common:: MemoizationMap ;
33
32
use util:: nodemap:: NodeSet ;
34
- use util:: nodemap:: FxHashMap ;
33
+ use util:: nodemap:: { FxHashMap , FxHashSet } ;
35
34
36
35
use serialize:: { self , Encodable , Encoder } ;
37
36
use std:: borrow:: Cow ;
@@ -1393,13 +1392,12 @@ impl<'tcx> serialize::UseSpecializedDecodable for AdtDef<'tcx> {}
1393
1392
impl < ' a , ' gcx , ' tcx > AdtDefData < ' tcx , ' static > {
1394
1393
#[ inline]
1395
1394
pub fn is_uninhabited_recurse ( & ' tcx self ,
1396
- visited : & mut HashMap < ( DefId , & ' tcx Substs < ' tcx > ) , ( ) > ,
1395
+ visited : & mut FxHashSet < ( DefId , & ' tcx Substs < ' tcx > ) > ,
1397
1396
block : Option < NodeId > ,
1398
1397
cx : TyCtxt < ' a , ' gcx , ' tcx > ,
1399
1398
substs : & ' tcx Substs < ' tcx > ) -> bool {
1400
- match visited. entry ( ( self . did , substs) ) {
1401
- hash_map:: Entry :: Occupied ( _) => return false ,
1402
- hash_map:: Entry :: Vacant ( ve) => ve. insert ( ( ) ) ,
1399
+ if !visited. insert ( ( self . did , substs) ) {
1400
+ return false ;
1403
1401
} ;
1404
1402
self . variants . iter ( ) . all ( |v| {
1405
1403
v. is_uninhabited_recurse ( visited, block, cx, substs, self . is_union ( ) )
@@ -1811,7 +1809,7 @@ impl<'tcx, 'container> VariantDefData<'tcx, 'container> {
1811
1809
impl < ' a , ' gcx , ' tcx > VariantDefData < ' tcx , ' static > {
1812
1810
#[ inline]
1813
1811
pub fn is_uninhabited_recurse ( & ' tcx self ,
1814
- visited : & mut HashMap < ( DefId , & ' tcx Substs < ' tcx > ) , ( ) > ,
1812
+ visited : & mut FxHashSet < ( DefId , & ' tcx Substs < ' tcx > ) > ,
1815
1813
block : Option < NodeId > ,
1816
1814
cx : TyCtxt < ' a , ' gcx , ' tcx > ,
1817
1815
substs : & ' tcx Substs < ' tcx > ,
@@ -1852,7 +1850,7 @@ impl<'a, 'gcx, 'tcx, 'container> FieldDefData<'tcx, 'container> {
1852
1850
impl < ' a , ' gcx , ' tcx > FieldDefData < ' tcx , ' static > {
1853
1851
#[ inline]
1854
1852
pub fn is_uninhabited_recurse ( & ' tcx self ,
1855
- visited : & mut HashMap < ( DefId , & ' tcx Substs < ' tcx > ) , ( ) > ,
1853
+ visited : & mut FxHashSet < ( DefId , & ' tcx Substs < ' tcx > ) > ,
1856
1854
block : Option < NodeId > ,
1857
1855
tcx : TyCtxt < ' a , ' gcx , ' tcx > ,
1858
1856
substs : & ' tcx Substs < ' tcx > ) -> bool {
0 commit comments