From a1676741a8d664b1f3f850c0431f1418ce5aa99a Mon Sep 17 00:00:00 2001 From: Federico Poli Date: Wed, 6 Mar 2024 09:56:31 +0100 Subject: [PATCH] Disable MIR optimization in tests --- prusti-tests/tests/compiletest.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prusti-tests/tests/compiletest.rs b/prusti-tests/tests/compiletest.rs index c1dafc5a37b..6c2ff38516d 100644 --- a/prusti-tests/tests/compiletest.rs +++ b/prusti-tests/tests/compiletest.rs @@ -83,7 +83,11 @@ fn run_prusti_tests(group_name: &str, filter: &Option, rustc_flags: Opti } // Add compilation flags - config.target_rustcflags = Some(format!("--edition=2018 {}", rustc_flags.unwrap_or(""))); + // mir-opt-level=0 disabled MIR optimizations (e.g., const propagation) that might hide bugs. + config.target_rustcflags = Some(format!( + "--edition=2018 -Z mir-opt-level=0 {}", + rustc_flags.unwrap_or("") + )); let path: PathBuf = ["tests", group_name, "ui"].iter().collect(); if path.exists() {