From 5486c19e14ea1a35629791e3c62cbbe64b6c8c83 Mon Sep 17 00:00:00 2001 From: Vytautas Astrauskas Date: Thu, 20 Jul 2023 17:27:04 +0200 Subject: [PATCH] A random change to see whether crashes are fixed. --- prusti-interface/src/environment/body.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/prusti-interface/src/environment/body.rs b/prusti-interface/src/environment/body.rs index bf40d50596b..009ae794eaa 100644 --- a/prusti-interface/src/environment/body.rs +++ b/prusti-interface/src/environment/body.rs @@ -199,11 +199,18 @@ impl<'tcx> EnvBody<'tcx> { /// Get the MIR body of a local impure function, monomorphised /// with the given type substitutions. + /// + /// FIXME: This function is called only in pure contexts??? pub fn get_impure_fn_body(&self, def_id: LocalDefId, substs: SubstsRef<'tcx>) -> MirBody<'tcx> { if let Some(body) = self.get_monomorphised(def_id.to_def_id(), substs, None) { return body; } - let body = self.get_impure_fn_body_identity(def_id); + // let body = self.get_impure_fn_body_identity(def_id); + let body = if let Some(body) = self.pure_fns.local.get(&def_id) { + body.clone() + } else { + Self::load_local_mir(self.tcx, def_id) + }; self.set_monomorphised(def_id.to_def_id(), substs, None, body) }