@@ -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;
@@ -1109,13 +1109,19 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11091109 let ty_var_id = self . type_variables . borrow_mut ( ) . new_var (
11101110 self . universe ( ) ,
11111111 false ,
1112- TypeVariableOrigin :: TypeParameterDefinition ( span, param. name ) ,
1112+ TypeVariableOrigin {
1113+ kind : TypeVariableOriginKind :: TypeParameterDefinition ( param. name ) ,
1114+ span,
1115+ } ,
11131116 ) ;
11141117
11151118 self . tcx . mk_ty_var ( ty_var_id) . into ( )
11161119 }
11171120 GenericParamDefKind :: Const { .. } => {
1118- let origin = ConstVariableOrigin :: ConstParameterDefinition ( span, param. name ) ;
1121+ let origin = ConstVariableOrigin {
1122+ kind : ConstVariableOriginKind :: ConstParameterDefinition ( param. name ) ,
1123+ span,
1124+ } ;
11191125 let const_var_id =
11201126 self . const_unification_table
11211127 . borrow_mut ( )
@@ -1411,8 +1417,16 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
14111417 T : TypeFoldable < ' tcx >
14121418 {
14131419 let fld_r = |br| self . next_region_var ( LateBoundRegion ( span, br, lbrct) ) ;
1414- let fld_t = |_| self . next_ty_var ( TypeVariableOrigin :: MiscVariable ( span) ) ;
1415- let fld_c = |_, ty| self . next_const_var ( ty, ConstVariableOrigin :: MiscVariable ( span) ) ;
1420+ let fld_t = |_| {
1421+ self . next_ty_var ( TypeVariableOrigin {
1422+ kind : TypeVariableOriginKind :: MiscVariable ,
1423+ span,
1424+ } )
1425+ } ;
1426+ let fld_c = |_, ty| self . next_const_var ( ty, ConstVariableOrigin {
1427+ kind : ConstVariableOriginKind :: MiscVariable ,
1428+ span,
1429+ } ) ;
14161430 self . tcx . replace_bound_vars ( value, fld_r, fld_t, fld_c)
14171431 }
14181432
0 commit comments