@@ -284,18 +284,6 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
284
284
ty:: InstanceDef :: DropGlue ( ..) |
285
285
ty:: InstanceDef :: CloneShim ( ..) |
286
286
ty:: InstanceDef :: Item ( _) => {
287
- // If this function is a `const fn` then as an optimization we can query this
288
- // evaluation immediately.
289
- //
290
- // For the moment we only do this for functions which take no arguments
291
- // (or all arguments are ZSTs) so that we don't memoize too much.
292
- if self . tcx . is_const_fn_raw ( instance. def . def_id ( ) ) &&
293
- args. iter ( ) . all ( |a| a. layout . is_zst ( ) )
294
- {
295
- let gid = GlobalId { instance, promoted : None } ;
296
- return self . eval_const_fn_call ( gid, ret) ;
297
- }
298
-
299
287
// We need MIR for this fn
300
288
let body = match M :: find_fn ( self , instance, args, ret, unwind) ? {
301
289
Some ( body) => body,
@@ -463,7 +451,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
463
451
464
452
/// Evaluate a const function where all arguments (if any) are zero-sized types.
465
453
/// The evaluation is memoized thanks to the query system.
466
- fn eval_const_fn_call (
454
+ pub ( crate ) fn eval_const_fn_call (
467
455
& mut self ,
468
456
gid : GlobalId < ' tcx > ,
469
457
ret : Option < ( PlaceTy < ' tcx , M :: PointerTag > , mir:: BasicBlock ) > ,
0 commit comments