1313pub use self :: LateBoundRegionConversionTime :: * ;
1414pub use self :: RegionVariableOrigin :: * ;
1515pub use self :: SubregionOrigin :: * ;
16- pub use self :: TypeOrigin :: * ;
1716pub use self :: ValuePairs :: * ;
1817pub use middle:: ty:: IntVarValue ;
1918pub use self :: freshen:: TypeFreshener ;
@@ -440,7 +439,7 @@ pub fn can_mk_subty<'a, 'tcx>(cx: &InferCtxt<'a, 'tcx>,
440439 debug ! ( "can_mk_subty({:?} <: {:?})" , a, b) ;
441440 cx. probe ( |_| {
442441 let trace = TypeTrace {
443- origin : Misc ( codemap:: DUMMY_SP ) ,
442+ origin : TypeOrigin :: Misc ( codemap:: DUMMY_SP ) ,
444443 values : Types ( expected_found ( true , a, b) )
445444 } ;
446445 cx. sub ( true , trace) . relate ( & a, & b) . map ( |_| ( ) )
@@ -950,7 +949,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
950949 self . commit_if_ok ( |snapshot| {
951950 let ( ty:: EquatePredicate ( a, b) , skol_map) =
952951 self . skolemize_late_bound_regions ( predicate, snapshot) ;
953- let origin = EquatePredicate ( span) ;
952+ let origin = TypeOrigin :: EquatePredicate ( span) ;
954953 let ( ) = try!( mk_eqty ( self , false , origin, a, b) ) ;
955954 self . leak_check ( & skol_map, snapshot)
956955 } )
@@ -1328,7 +1327,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13281327 actual : Ty < ' tcx > ,
13291328 err : & TypeError < ' tcx > ) {
13301329 let trace = TypeTrace {
1331- origin : Misc ( span) ,
1330+ origin : TypeOrigin :: Misc ( span) ,
13321331 values : Types ( ExpectedFound {
13331332 expected : expected,
13341333 found : actual
@@ -1342,7 +1341,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13421341 expected : type_variable:: Default < ' tcx > ,
13431342 actual : type_variable:: Default < ' tcx > ) {
13441343 let trace = TypeTrace {
1345- origin : Misc ( span) ,
1344+ origin : TypeOrigin :: Misc ( span) ,
13461345 values : Types ( ExpectedFound {
13471346 expected : expected. ty ,
13481347 found : actual. ty
@@ -1393,8 +1392,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
13931392 // generic so we don't have to do anything quite this
13941393 // terrible.
13951394 let e = self . tcx . types . err ;
1396- let trace = TypeTrace { origin : Misc ( codemap:: DUMMY_SP ) ,
1397- values : Types ( expected_found ( true , e, e) ) } ;
1395+ let trace = TypeTrace {
1396+ origin : TypeOrigin :: Misc ( codemap:: DUMMY_SP ) ,
1397+ values : Types ( expected_found ( true , e, e) )
1398+ } ;
13981399 self . equate ( true , trace) . relate ( a, b)
13991400 } ) . map ( |_| ( ) )
14001401 }
@@ -1525,7 +1526,7 @@ impl<'tcx> TypeTrace<'tcx> {
15251526
15261527 pub fn dummy ( tcx : & ty:: ctxt < ' tcx > ) -> TypeTrace < ' tcx > {
15271528 TypeTrace {
1528- origin : Misc ( codemap:: DUMMY_SP ) ,
1529+ origin : TypeOrigin :: Misc ( codemap:: DUMMY_SP ) ,
15291530 values : Types ( ExpectedFound {
15301531 expected : tcx. types . err ,
15311532 found : tcx. types . err ,
@@ -1543,17 +1544,17 @@ impl<'tcx> fmt::Debug for TypeTrace<'tcx> {
15431544impl TypeOrigin {
15441545 pub fn span ( & self ) -> Span {
15451546 match * self {
1546- MethodCompatCheck ( span) => span,
1547- ExprAssignable ( span) => span,
1548- Misc ( span) => span,
1549- RelateTraitRefs ( span) => span,
1550- RelateSelfType ( span) => span,
1551- RelateOutputImplTypes ( span) => span,
1552- MatchExpressionArm ( match_span, _, _) => match_span,
1553- IfExpression ( span) => span,
1554- IfExpressionWithNoElse ( span) => span,
1555- RangeExpression ( span) => span,
1556- EquatePredicate ( span) => span,
1547+ TypeOrigin :: MethodCompatCheck ( span) => span,
1548+ TypeOrigin :: ExprAssignable ( span) => span,
1549+ TypeOrigin :: Misc ( span) => span,
1550+ TypeOrigin :: RelateTraitRefs ( span) => span,
1551+ TypeOrigin :: RelateSelfType ( span) => span,
1552+ TypeOrigin :: RelateOutputImplTypes ( span) => span,
1553+ TypeOrigin :: MatchExpressionArm ( match_span, _, _) => match_span,
1554+ TypeOrigin :: IfExpression ( span) => span,
1555+ TypeOrigin :: IfExpressionWithNoElse ( span) => span,
1556+ TypeOrigin :: RangeExpression ( span) => span,
1557+ TypeOrigin :: EquatePredicate ( span) => span,
15571558 }
15581559 }
15591560}
0 commit comments