@@ -2,23 +2,18 @@ use std::cmp;
22use std:: marker:: PhantomData ;
33
44use rustc_data_structures:: unify:: { NoError , UnifyKey , UnifyValue } ;
5+ use rustc_middle:: { bug, ty} ;
56use rustc_span:: Span ;
67use rustc_span:: def_id:: DefId ;
78
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-
149#[ derive( Copy , Clone , Debug ) ]
15- pub enum RegionVariableValue < ' tcx > {
10+ pub ( crate ) enum RegionVariableValue < ' tcx > {
1611 Known { value : ty:: Region < ' tcx > } ,
1712 Unknown { universe : ty:: UniverseIndex } ,
1813}
1914
2015#[ derive( PartialEq , Copy , Clone , Debug ) ]
21- pub struct RegionVidKey < ' tcx > {
16+ pub ( crate ) struct RegionVidKey < ' tcx > {
2217 pub vid : ty:: RegionVid ,
2318 pub phantom : PhantomData < RegionVariableValue < ' tcx > > ,
2419}
@@ -44,7 +39,8 @@ impl<'tcx> UnifyKey for RegionVidKey<'tcx> {
4439 }
4540}
4641
47- pub struct RegionUnificationError ;
42+ pub ( crate ) struct RegionUnificationError ;
43+
4844impl < ' tcx > UnifyValue for RegionVariableValue < ' tcx > {
4945 type Error = RegionUnificationError ;
5046
@@ -100,15 +96,15 @@ pub struct ConstVariableOrigin {
10096}
10197
10298#[ derive( Copy , Clone , Debug ) ]
103- pub enum ConstVariableValue < ' tcx > {
99+ pub ( crate ) enum ConstVariableValue < ' tcx > {
104100 Known { value : ty:: Const < ' tcx > } ,
105101 Unknown { origin : ConstVariableOrigin , universe : ty:: UniverseIndex } ,
106102}
107103
108104impl < ' tcx > ConstVariableValue < ' tcx > {
109105 /// If this value is known, returns the const it is known to be.
110106 /// Otherwise, `None`.
111- pub fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
107+ pub ( crate ) fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
112108 match * self {
113109 ConstVariableValue :: Unknown { .. } => None ,
114110 ConstVariableValue :: Known { value } => Some ( value) ,
@@ -117,7 +113,7 @@ impl<'tcx> ConstVariableValue<'tcx> {
117113}
118114
119115#[ derive( PartialEq , Copy , Clone , Debug ) ]
120- pub struct ConstVidKey < ' tcx > {
116+ pub ( crate ) struct ConstVidKey < ' tcx > {
121117 pub vid : ty:: ConstVid ,
122118 pub phantom : PhantomData < ty:: Const < ' tcx > > ,
123119}
0 commit comments