@@ -2,19 +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;
9
-
10
9
#[ derive( Copy , Clone , Debug ) ]
11
- pub enum RegionVariableValue < ' tcx > {
10
+ pub ( crate ) enum RegionVariableValue < ' tcx > {
12
11
Known { value : ty:: Region < ' tcx > } ,
13
12
Unknown { universe : ty:: UniverseIndex } ,
14
13
}
15
14
16
15
#[ derive( PartialEq , Copy , Clone , Debug ) ]
17
- pub struct RegionVidKey < ' tcx > {
16
+ pub ( crate ) struct RegionVidKey < ' tcx > {
18
17
pub vid : ty:: RegionVid ,
19
18
pub phantom : PhantomData < RegionVariableValue < ' tcx > > ,
20
19
}
@@ -40,7 +39,8 @@ impl<'tcx> UnifyKey for RegionVidKey<'tcx> {
40
39
}
41
40
}
42
41
43
- pub struct RegionUnificationError ;
42
+ pub ( crate ) struct RegionUnificationError ;
43
+
44
44
impl < ' tcx > UnifyValue for RegionVariableValue < ' tcx > {
45
45
type Error = RegionUnificationError ;
46
46
@@ -96,15 +96,15 @@ pub struct ConstVariableOrigin {
96
96
}
97
97
98
98
#[ derive( Copy , Clone , Debug ) ]
99
- pub enum ConstVariableValue < ' tcx > {
99
+ pub ( crate ) enum ConstVariableValue < ' tcx > {
100
100
Known { value : ty:: Const < ' tcx > } ,
101
101
Unknown { origin : ConstVariableOrigin , universe : ty:: UniverseIndex } ,
102
102
}
103
103
104
104
impl < ' tcx > ConstVariableValue < ' tcx > {
105
105
/// If this value is known, returns the const it is known to be.
106
106
/// Otherwise, `None`.
107
- pub fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
107
+ pub ( crate ) fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
108
108
match * self {
109
109
ConstVariableValue :: Unknown { .. } => None ,
110
110
ConstVariableValue :: Known { value } => Some ( value) ,
@@ -113,7 +113,7 @@ impl<'tcx> ConstVariableValue<'tcx> {
113
113
}
114
114
115
115
#[ derive( PartialEq , Copy , Clone , Debug ) ]
116
- pub struct ConstVidKey < ' tcx > {
116
+ pub ( crate ) struct ConstVidKey < ' tcx > {
117
117
pub vid : ty:: ConstVid ,
118
118
pub phantom : PhantomData < ty:: Const < ' tcx > > ,
119
119
}
0 commit comments