@@ -2,23 +2,18 @@ use std::cmp;
2
2
use std:: marker:: PhantomData ;
3
3
4
4
use rustc_data_structures:: unify:: { NoError , UnifyKey , UnifyValue } ;
5
+ use rustc_middle:: { bug, ty} ;
5
6
use rustc_span:: Span ;
6
7
use rustc_span:: def_id:: DefId ;
7
8
8
- use crate :: ty:: { self , Ty , TyCtxt } ;
9
-
10
- pub trait ToType {
11
- fn to_type < ' tcx > ( & self , tcx : TyCtxt < ' tcx > ) -> Ty < ' tcx > ;
12
- }
13
-
14
9
#[ derive( Copy , Clone , Debug ) ]
15
- pub enum RegionVariableValue < ' tcx > {
10
+ pub ( crate ) enum RegionVariableValue < ' tcx > {
16
11
Known { value : ty:: Region < ' tcx > } ,
17
12
Unknown { universe : ty:: UniverseIndex } ,
18
13
}
19
14
20
15
#[ derive( PartialEq , Copy , Clone , Debug ) ]
21
- pub struct RegionVidKey < ' tcx > {
16
+ pub ( crate ) struct RegionVidKey < ' tcx > {
22
17
pub vid : ty:: RegionVid ,
23
18
pub phantom : PhantomData < RegionVariableValue < ' tcx > > ,
24
19
}
@@ -44,7 +39,8 @@ impl<'tcx> UnifyKey for RegionVidKey<'tcx> {
44
39
}
45
40
}
46
41
47
- pub struct RegionUnificationError ;
42
+ pub ( crate ) struct RegionUnificationError ;
43
+
48
44
impl < ' tcx > UnifyValue for RegionVariableValue < ' tcx > {
49
45
type Error = RegionUnificationError ;
50
46
@@ -100,15 +96,15 @@ pub struct ConstVariableOrigin {
100
96
}
101
97
102
98
#[ derive( Copy , Clone , Debug ) ]
103
- pub enum ConstVariableValue < ' tcx > {
99
+ pub ( crate ) enum ConstVariableValue < ' tcx > {
104
100
Known { value : ty:: Const < ' tcx > } ,
105
101
Unknown { origin : ConstVariableOrigin , universe : ty:: UniverseIndex } ,
106
102
}
107
103
108
104
impl < ' tcx > ConstVariableValue < ' tcx > {
109
105
/// If this value is known, returns the const it is known to be.
110
106
/// Otherwise, `None`.
111
- pub fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
107
+ pub ( crate ) fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
112
108
match * self {
113
109
ConstVariableValue :: Unknown { .. } => None ,
114
110
ConstVariableValue :: Known { value } => Some ( value) ,
@@ -117,7 +113,7 @@ impl<'tcx> ConstVariableValue<'tcx> {
117
113
}
118
114
119
115
#[ derive( PartialEq , Copy , Clone , Debug ) ]
120
- pub struct ConstVidKey < ' tcx > {
116
+ pub ( crate ) struct ConstVidKey < ' tcx > {
121
117
pub vid : ty:: ConstVid ,
122
118
pub phantom : PhantomData < ty:: Const < ' tcx > > ,
123
119
}
0 commit comments