diff options
| author | Rich Kadel <richkadel@google.com> | 2020-11-25 11:38:09 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-25 11:38:09 -0800 |
| commit | b1df6c0e63ae1b5f42a1039e03ce77a491780147 (patch) | |
| tree | 47679cde8fb51a3d480796d53f697fc965144d36 /compiler/rustc_codegen_llvm/src | |
| parent | b4668ecb7317fe821844d89d27a718e50c930215 (diff) | |
| download | rust-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.rs | 4 |
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(), |
