@@ -39,8 +39,8 @@ use self::lexical_region_resolve::LexicalRegionResolutions;
3939use self :: outlives:: env:: OutlivesEnvironment ;
4040use self :: region_constraints:: { GenericKind , RegionConstraintData , VarInfos , VerifyBound } ;
4141use self :: region_constraints:: { RegionConstraintCollector , RegionSnapshot } ;
42- use self :: type_variable:: TypeVariableOrigin ;
43- use self :: unify_key:: { ToType , ConstVariableOrigin } ;
42+ use self :: type_variable:: { TypeVariableOrigin , TypeVariableOriginKind } ;
43+ use self :: unify_key:: { ToType , ConstVariableOrigin , ConstVariableOriginKind } ;
4444
4545pub mod at;
4646pub mod canonical;
@@ -1110,13 +1110,19 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11101110 let ty_var_id = self . type_variables . borrow_mut ( ) . new_var (
11111111 self . universe ( ) ,
11121112 false ,
1113- TypeVariableOrigin :: TypeParameterDefinition ( span, param. name ) ,
1113+ TypeVariableOrigin {
1114+ kind : TypeVariableOriginKind :: TypeParameterDefinition ( param. name ) ,
1115+ span,
1116+ } ,
11141117 ) ;
11151118
11161119 self . tcx . mk_ty_var ( ty_var_id) . into ( )
11171120 }
11181121 GenericParamDefKind :: Const { .. } => {
1119- let origin = ConstVariableOrigin :: ConstParameterDefinition ( span, param. name ) ;
1122+ let origin = ConstVariableOrigin {
1123+ kind : ConstVariableOriginKind :: ConstParameterDefinition ( param. name ) ,
1124+ span,
1125+ } ;
11201126 let const_var_id =
11211127 self . const_unification_table
11221128 . borrow_mut ( )
@@ -1412,8 +1418,16 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
14121418 T : TypeFoldable < ' tcx >
14131419 {
14141420 let fld_r = |br| self . next_region_var ( LateBoundRegion ( span, br, lbrct) ) ;
1415- let fld_t = |_| self . next_ty_var ( TypeVariableOrigin :: MiscVariable ( span) ) ;
1416- let fld_c = |_, ty| self . next_const_var ( ty, ConstVariableOrigin :: MiscVariable ( span) ) ;
1421+ let fld_t = |_| {
1422+ self . next_ty_var ( TypeVariableOrigin {
1423+ kind : TypeVariableOriginKind :: MiscVariable ,
1424+ span,
1425+ } )
1426+ } ;
1427+ let fld_c = |_, ty| self . next_const_var ( ty, ConstVariableOrigin {
1428+ kind : ConstVariableOriginKind :: MiscVariable ,
1429+ span,
1430+ } ) ;
14171431 self . tcx . replace_bound_vars ( value, fld_r, fld_t, fld_c)
14181432 }
14191433
0 commit comments