@@ -23,7 +23,7 @@ impl<'tcx> TyCtxt<'tcx> {
23
23
// into `const_eval` which will return `ErrorHandled::TooGeneric` if any of them are
24
24
// encountered.
25
25
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) ;
27
27
let cid = GlobalId { instance, promoted : None } ;
28
28
let typing_env = ty:: TypingEnv :: post_analysis ( self , def_id) ;
29
29
self . const_eval_global_id ( typing_env, cid, DUMMY_SP )
@@ -39,7 +39,7 @@ impl<'tcx> TyCtxt<'tcx> {
39
39
// into `const_eval` which will return `ErrorHandled::TooGeneric` if any of them are
40
40
// encountered.
41
41
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) ;
43
43
let cid = GlobalId { instance, promoted : None } ;
44
44
let typing_env = ty:: TypingEnv :: post_analysis ( self , def_id) ;
45
45
let inputs = self . erase_regions ( typing_env. as_query_input ( cid) ) ;
@@ -209,7 +209,7 @@ impl<'tcx> TyCtxtEnsureOk<'tcx> {
209
209
// into `const_eval` which will return `ErrorHandled::TooGeneric` if any of them are
210
210
// encountered.
211
211
let args = GenericArgs :: identity_for_item ( self . tcx , def_id) ;
212
- let instance = ty:: Instance :: new ( def_id, self . tcx . erase_regions ( args) ) ;
212
+ let instance = ty:: Instance :: new_raw ( def_id, self . tcx . erase_regions ( args) ) ;
213
213
let cid = GlobalId { instance, promoted : None } ;
214
214
let typing_env = ty:: TypingEnv :: post_analysis ( self . tcx , def_id) ;
215
215
// Const-eval shouldn't depend on lifetimes at all, so we can erase them, which should
0 commit comments