about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorRich Kadel <richkadel@google.com>2020-11-25 11:38:09 -0800
committerGitHub <noreply@github.com>2020-11-25 11:38:09 -0800
commitb1df6c0e63ae1b5f42a1039e03ce77a491780147 (patch)
tree47679cde8fb51a3d480796d53f697fc965144d36 /compiler/rustc_codegen_llvm/src
parentb4668ecb7317fe821844d89d27a718e50c930215 (diff)
downloadrust-b1df6c0e63ae1b5f42a1039e03ce77a491780147.tar.gz
rust-b1df6c0e63ae1b5f42a1039e03ce77a491780147.zip
replace assert with condition and `fatal` error
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
index ff65726c837..87eada5d557 100644
--- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
+++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs
@@ -29,7 +29,9 @@ pub fn finalize<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) {
     // Ensure LLVM supports Coverage Map Version 4 (encoded as a zero-based value: 3).
     // If not, the LLVM Version must be less than 11.
     let version = coverageinfo::mapping_version();
-    assert_eq!(version, 3, "rustc option `-Z instrument-coverage` requires LLVM 11 or higher.");
+    if version != 3 {
+        cx.tcx.sess.fatal("rustc option `-Z instrument-coverage` requires LLVM 11 or higher.");
+    }```
 
     let function_coverage_map = match cx.coverage_context() {
         Some(ctx) => ctx.take_function_coverage_map(),