Skip to content

Commit b1df6c0

Browse files
authored
replace assert with condition and fatal error
1 parent b4668ec commit b1df6c0

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_codegen_llvm/src/coverageinfo

1 file changed

+3
-1
lines changed

compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
2929
// Ensure LLVM supports Coverage Map Version 4 (encoded as a zero-based value: 3).
3030
// If not, the LLVM Version must be less than 11.
3131
let version = coverageinfo::mapping_version();
32-
assert_eq!(version, 3, "rustc option `-Z instrument-coverage` requires LLVM 11 or higher.");
32+
if version != 3 {
33+
cx.tcx.sess.fatal("rustc option `-Z instrument-coverage` requires LLVM 11 or higher.");
34+
}```
3335

3436
let function_coverage_map = match cx.coverage_context() {
3537
Some(ctx) => ctx.take_function_coverage_map(),

0 commit comments

Comments
 (0)