@@ -6,28 +6,18 @@ use std::fmt::Debug;
66use std:: hash:: Hash ;
77use std:: iter;
88
9- use self :: SimplifiedTypeGen :: * ;
9+ use self :: SimplifiedType :: * ;
1010
11- pub type SimplifiedType = SimplifiedTypeGen < DefId > ;
12-
13- /// See `simplify_type`
14- ///
15- /// Note that we keep this type generic over the type of identifier it uses
16- /// because we sometimes need to use SimplifiedTypeGen values as stable sorting
17- /// keys (in which case we use a DefPathHash as id-type) but in the general case
18- /// the non-stable but fast to construct DefId-version is the better choice.
11+ /// See `simplify_type`.
1912#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , TyEncodable , TyDecodable , HashStable ) ]
20- pub enum SimplifiedTypeGen < D >
21- where
22- D : Copy + Debug + Eq ,
23- {
13+ pub enum SimplifiedType {
2414 BoolSimplifiedType ,
2515 CharSimplifiedType ,
2616 IntSimplifiedType ( ty:: IntTy ) ,
2717 UintSimplifiedType ( ty:: UintTy ) ,
2818 FloatSimplifiedType ( ty:: FloatTy ) ,
29- AdtSimplifiedType ( D ) ,
30- ForeignSimplifiedType ( D ) ,
19+ AdtSimplifiedType ( DefId ) ,
20+ ForeignSimplifiedType ( DefId ) ,
3121 StrSimplifiedType ,
3222 ArraySimplifiedType ,
3323 SliceSimplifiedType ,
3828 /// A trait object, all of whose components are markers
3929 /// (e.g., `dyn Send + Sync`).
4030 MarkerTraitObjectSimplifiedType ,
41- TraitSimplifiedType ( D ) ,
42- ClosureSimplifiedType ( D ) ,
43- GeneratorSimplifiedType ( D ) ,
31+ TraitSimplifiedType ( DefId ) ,
32+ ClosureSimplifiedType ( DefId ) ,
33+ GeneratorSimplifiedType ( DefId ) ,
4434 GeneratorWitnessSimplifiedType ( usize ) ,
4535 FunctionSimplifiedType ( usize ) ,
4636 PlaceholderSimplifiedType ,
@@ -142,8 +132,8 @@ pub fn simplify_type<'tcx>(
142132 }
143133}
144134
145- impl < D : Copy + Debug + Eq > SimplifiedTypeGen < D > {
146- pub fn def ( self ) -> Option < D > {
135+ impl SimplifiedType {
136+ pub fn def ( self ) -> Option < DefId > {
147137 match self {
148138 AdtSimplifiedType ( d)
149139 | ForeignSimplifiedType ( d)
0 commit comments