@@ -23,7 +23,7 @@ impl<'tcx> TyCtxt<'tcx> {
2323 // into `const_eval` which will return `ErrorHandled::TooGeneric` if any of them are
2424 // encountered.
2525 let args = GenericArgs :: identity_for_item ( self , def_id) ;
26- let instance = ty:: Instance :: new ( def_id, args) ;
26+ let instance = ty:: Instance :: new_raw ( def_id, args) ;
2727 let cid = GlobalId { instance, promoted : None } ;
2828 let typing_env = ty:: TypingEnv :: post_analysis ( self , def_id) ;
2929 self . const_eval_global_id ( typing_env, cid, DUMMY_SP )
@@ -39,7 +39,7 @@ impl<'tcx> TyCtxt<'tcx> {
3939 // into `const_eval` which will return `ErrorHandled::TooGeneric` if any of them are
4040 // encountered.
4141 let args = GenericArgs :: identity_for_item ( self , def_id) ;
42- let instance = ty:: Instance :: new ( def_id, args) ;
42+ let instance = ty:: Instance :: new_raw ( def_id, args) ;
4343 let cid = GlobalId { instance, promoted : None } ;
4444 let typing_env = ty:: TypingEnv :: post_analysis ( self , def_id) ;
4545 let inputs = self . erase_regions ( typing_env. as_query_input ( cid) ) ;
@@ -208,7 +208,7 @@ impl<'tcx> TyCtxtEnsureOk<'tcx> {
208208 // into `const_eval` which will return `ErrorHandled::TooGeneric` if any of them are
209209 // encountered.
210210 let args = GenericArgs :: identity_for_item ( self . tcx , def_id) ;
211- let instance = ty:: Instance :: new ( def_id, self . tcx . erase_regions ( args) ) ;
211+ let instance = ty:: Instance :: new_raw ( def_id, self . tcx . erase_regions ( args) ) ;
212212 let cid = GlobalId { instance, promoted : None } ;
213213 let typing_env = ty:: TypingEnv :: post_analysis ( self . tcx , def_id) ;
214214 // Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
0 commit comments