@@ -284,18 +284,6 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
284284 ty:: InstanceDef :: DropGlue ( ..) |
285285 ty:: InstanceDef :: CloneShim ( ..) |
286286 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-
299287 // We need MIR for this fn
300288 let body = match M :: find_fn ( self , instance, args, ret, unwind) ? {
301289 Some ( body) => body,
@@ -463,7 +451,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
463451
464452 /// Evaluate a const function where all arguments (if any) are zero-sized types.
465453 /// The evaluation is memoized thanks to the query system.
466- fn eval_const_fn_call (
454+ pub ( crate ) fn eval_const_fn_call (
467455 & mut self ,
468456 gid : GlobalId < ' tcx > ,
469457 ret : Option < ( PlaceTy < ' tcx , M :: PointerTag > , mir:: BasicBlock ) > ,
0 commit comments