Repository: intellij-rust/intellij-rust
Issue: Code coverage not shown, java.lang.NumberFormatException thrown in console

<!--
Hello and thank you for the issue!
If you would like to report a bug, we have added some points below that you can fill out.
Consider using "Help | Create New Issue" action that fills out all necessary information automatically.
Feel free to remove all the irrelevant text to request a new feature.
-->

## Environment

* **IntelliJ Rust plugin version:** 0.4.151.3997-211
* **Rust toolchain version:** 1.55.0-nightly (cebef2951 2021-07-22)
* **IDE name and version:** CLion 2021.1.2  Build #CL-211.7442.42
* **Operating system:** NixOS 21.05

## Problem description

Hello, I'm getting the following issue after running my tests with coverage:

```
java.lang.NumberFormatException: For input string: "3747759300"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.base/java.lang.Integer.parseInt(Integer.java:652)
        at java.base/java.lang.Integer.parseInt(Integer.java:770)
        at org.rust.coverage.LcovCoverageReport$Serialization$readLcov$1.invoke(LcovCoverageReport.kt:65)
        at org.rust.coverage.LcovCoverageReport$Serialization$readLcov$1.invoke(LcovCoverageReport.kt:51)
        at kotlin.io.TextStreamsKt.forEachLine(ReadWrite.kt:155)
        at kotlin.io.FilesKt__FileReadWriteKt.forEachLine(FileReadWrite.kt:190)
        at kotlin.io.FilesKt__FileReadWriteKt.forEachLine$default(FileReadWrite.kt:188)
        at org.rust.coverage.LcovCoverageReport$Serialization.readLcov(LcovCoverageReport.kt:51)
        at org.rust.coverage.RsCoverageRunner$Companion.readProjectData(RsCoverageRunner.kt:67)
        at org.rust.coverage.RsCoverageRunner$Companion.access$readProjectData(RsCoverageRunner.kt:47)
        at org.rust.coverage.RsCoverageRunner$loadCoverageData$1.invoke(RsCoverageRunner.kt:36)
        at org.rust.coverage.RsCoverageRunner$loadCoverageData$1.invoke(RsCoverageRunner.kt:35)
        at org.rust.openapiext.UtilsKt.computeWithCancelableProgress$lambda-8(utils.kt:242)
        at com.intellij.openapi.progress.impl.CoreProgressManager$1.run(CoreProgressManager.java:275)
        at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:998)
        at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:545)
        at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:78)
        at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:228)
        at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
        at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:228)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
        at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
        at java.base/java.lang.Thread.run(Thread.java:834)
2021-07-26 14:30:14,683 [3164262]  ERROR - llij.ide.plugins.PluginManager - CLion 2021.1.2  Build #CL-211.7442.42 
2021-07-26 14:30:14,683 [3164262]  ERROR - llij.ide.plugins.PluginManager - JDK: 11.0.10; VM: OpenJDK 64-Bit Server VM; Vendor: Oracle Corporation 
2021-07-26 14:30:14,683 [3164262]  ERROR - llij.ide.plugins.PluginManager - OS: Linux 
2021-07-26 14:30:14,684 [3164263]  ERROR - llij.ide.plugins.PluginManager - Plugin to blame: Rust version: 0.4.151.3997-211 
2021-07-26 14:30:14,684 [3164263]  ERROR - llij.ide.plugins.PluginManager - Last Action: SwitchCoverage 
```

I cannot open the coverage data for my project.

## Steps to reproduce

(Note about this: see my post lower down about a minimal working example to reproduce the exception.)

- Run tests with coverage
- Go to Run > Show coverage data...
- Select one of the coverage data entries
- Observe that nothing happens, but the above exception is thrown.


Changed files:
coverage/src/main/kotlin/org/rust/coverage/LcovCoverageReport.kt

diff --git a/coverage/src/main/kotlin/org/rust/coverage/LcovCoverageReport.kt b/coverage/src/main/kotlin/org/rust/coverage/LcovCoverageReport.kt
index fb10fb50a..8630127b2 100644
--- a/coverage/src/main/kotlin/org/rust/coverage/LcovCoverageReport.kt
+++ b/coverage/src/main/kotlin/org/rust/coverage/LcovCoverageReport.kt
@@ -35,7 +35,11 @@ class LcovCoverageReport {
         }
 
         fun addHits(hitCount: Int) {
-            hits += hitCount
+            when {
+                hits == -1 -> return
+                hitCount == -1 -> hits = hitCount
+                else -> hits += hitCount
+            }
         }
     }
 
@@ -61,8 +65,8 @@ class LcovCoverageReport {
                             .split(",")
                             .dropLastWhile { it.isEmpty() }
                         check(values.size == 2)
-                        val lineNum = Integer.parseInt(values[0])
-                        val hitCount = Integer.parseInt(values[1])
+                        val lineNum = values[0].toIntOrNull() ?: return@forEachLine
+                        val hitCount = values[1].toIntOrNull() ?: -1
                         val lineHits = LineHits(lineNum, hitCount)
                         lineDataList?.add(lineHits)
                     }