Skip to content

Commit 528f4c2

Browse files
authored
Disable MIR optimizations in tests (#1507)
1 parent daf0e86 commit 528f4c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: prusti-tests/tests/compiletest.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ fn run_prusti_tests(group_name: &str, filter: &Option<String>, rustc_flags: Opti
8383
}
8484

8585
// Add compilation flags
86-
config.target_rustcflags = Some(format!("--edition=2018 {}", rustc_flags.unwrap_or("")));
86+
// mir-opt-level=0 disables MIR optimizations (e.g., const propagation) that might hide bugs.
87+
config.target_rustcflags = Some(format!(
88+
"--edition=2018 -Z mir-opt-level=0 {}",
89+
rustc_flags.unwrap_or("")
90+
));
8791

8892
let path: PathBuf = ["tests", group_name, "ui"].iter().collect();
8993
if path.exists() {

0 commit comments

Comments
 (0)