@@ -2,19 +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;
9-
109#[ derive( Copy , Clone , Debug ) ]
11- pub enum RegionVariableValue < ' tcx > {
10+ pub ( crate ) enum RegionVariableValue < ' tcx > {
1211 Known { value : ty:: Region < ' tcx > } ,
1312 Unknown { universe : ty:: UniverseIndex } ,
1413}
1514
1615#[ derive( PartialEq , Copy , Clone , Debug ) ]
17- pub struct RegionVidKey < ' tcx > {
16+ pub ( crate ) struct RegionVidKey < ' tcx > {
1817 pub vid : ty:: RegionVid ,
1918 pub phantom : PhantomData < RegionVariableValue < ' tcx > > ,
2019}
@@ -40,7 +39,8 @@ impl<'tcx> UnifyKey for RegionVidKey<'tcx> {
4039 }
4140}
4241
43- pub struct RegionUnificationError ;
42+ pub ( crate ) struct RegionUnificationError ;
43+
4444impl < ' tcx > UnifyValue for RegionVariableValue < ' tcx > {
4545 type Error = RegionUnificationError ;
4646
@@ -96,15 +96,15 @@ pub struct ConstVariableOrigin {
9696}
9797
9898#[ derive( Copy , Clone , Debug ) ]
99- pub enum ConstVariableValue < ' tcx > {
99+ pub ( crate ) enum ConstVariableValue < ' tcx > {
100100 Known { value : ty:: Const < ' tcx > } ,
101101 Unknown { origin : ConstVariableOrigin , universe : ty:: UniverseIndex } ,
102102}
103103
104104impl < ' tcx > ConstVariableValue < ' tcx > {
105105 /// If this value is known, returns the const it is known to be.
106106 /// Otherwise, `None`.
107- pub fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
107+ pub ( crate ) fn known ( & self ) -> Option < ty:: Const < ' tcx > > {
108108 match * self {
109109 ConstVariableValue :: Unknown { .. } => None ,
110110 ConstVariableValue :: Known { value } => Some ( value) ,
@@ -113,7 +113,7 @@ impl<'tcx> ConstVariableValue<'tcx> {
113113}
114114
115115#[ derive( PartialEq , Copy , Clone , Debug ) ]
116- pub struct ConstVidKey < ' tcx > {
116+ pub ( crate ) struct ConstVidKey < ' tcx > {
117117 pub vid : ty:: ConstVid ,
118118 pub phantom : PhantomData < ty:: Const < ' tcx > > ,
119119}
0 commit comments