@@ -6,28 +6,18 @@ use std::fmt::Debug;
6
6
use std:: hash:: Hash ;
7
7
use std:: iter;
8
8
9
- use self :: SimplifiedTypeGen :: * ;
9
+ use self :: SimplifiedType :: * ;
10
10
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`.
19
12
#[ 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 {
24
14
BoolSimplifiedType ,
25
15
CharSimplifiedType ,
26
16
IntSimplifiedType ( ty:: IntTy ) ,
27
17
UintSimplifiedType ( ty:: UintTy ) ,
28
18
FloatSimplifiedType ( ty:: FloatTy ) ,
29
- AdtSimplifiedType ( D ) ,
30
- ForeignSimplifiedType ( D ) ,
19
+ AdtSimplifiedType ( DefId ) ,
20
+ ForeignSimplifiedType ( DefId ) ,
31
21
StrSimplifiedType ,
32
22
ArraySimplifiedType ,
33
23
SliceSimplifiedType ,
38
28
/// A trait object, all of whose components are markers
39
29
/// (e.g., `dyn Send + Sync`).
40
30
MarkerTraitObjectSimplifiedType ,
41
- TraitSimplifiedType ( D ) ,
42
- ClosureSimplifiedType ( D ) ,
43
- GeneratorSimplifiedType ( D ) ,
31
+ TraitSimplifiedType ( DefId ) ,
32
+ ClosureSimplifiedType ( DefId ) ,
33
+ GeneratorSimplifiedType ( DefId ) ,
44
34
GeneratorWitnessSimplifiedType ( usize ) ,
45
35
FunctionSimplifiedType ( usize ) ,
46
36
PlaceholderSimplifiedType ,
@@ -142,8 +132,8 @@ pub fn simplify_type<'tcx>(
142
132
}
143
133
}
144
134
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 > {
147
137
match self {
148
138
AdtSimplifiedType ( d)
149
139
| ForeignSimplifiedType ( d)
0 commit comments