Repository: intellij-rust/intellij-rust
Issue: Run tests with coverage results in "the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`" error

## Environment

* **IntelliJ Rust plugin version:** 0.3.128.3278-202
* **Rust toolchain version:** 1.47.0-nightly (792c645ca 2020-08-17) x86_64-apple-darwin
* **IDE name and version:** CLion 2020.2 (CL-202.6397.106)
* **Operating system:** macOS 10.15.6

## Problem description

Running tests with basic Run works fine, but Run with coverage fails with the following error

```
Testing started at 22:11 ...
/Users/jetbrains/.cargo/bin/cargo +nightly test --color=always --all-features --no-fail-fast -- -Z unstable-options --format=json --show-output
   Compiling proc-macro2 v1.0.19
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.38
   Compiling quote v1.0.7
   Compiling flow_impl_derive v0.10.0 (/Users/jetbrains/git/flow/flow_impl_derive)
error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort`

error: aborting due to previous error

error: could not compile `flow_impl_derive`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Process finished with exit code 101
```

## Steps to reproduce

1. Open https://github.com/andrewdavidmackenzie/flow/tree/master/flow_impl_derive
2. Run `test --all-features` cargo command with coverage  

Changed files:
coverage/src/test/kotlin/org/rust/coverage/RsCoverageTest.kt, coverage/src/main/kotlin/org/rust/coverage/GrcovRunner.kt

diff --git a/coverage/src/main/kotlin/org/rust/coverage/GrcovRunner.kt b/coverage/src/main/kotlin/org/rust/coverage/GrcovRunner.kt
index 62669c73a..5ff45cb7b 100644
--- a/coverage/src/main/kotlin/org/rust/coverage/GrcovRunner.kt
+++ b/coverage/src/main/kotlin/org/rust/coverage/GrcovRunner.kt
@@ -86,8 +86,7 @@ class GrcovRunner : RsDefaultProgramRunnerBase() {
             val environmentVariables = EnvironmentVariablesData.create(
                 oldVariables.envs + mapOf(
                     "CARGO_INCREMENTAL" to "0",
-                    "RUSTFLAGS" to "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort",
-                    "RUSTDOCFLAGS" to "-Cpanic=abort"
+                    "RUSTFLAGS" to "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off"
                 ),
                 oldVariables.isPassParentEnvs
             )
diff --git a/coverage/src/test/kotlin/org/rust/coverage/RsCoverageTest.kt b/coverage/src/test/kotlin/org/rust/coverage/RsCoverageTest.kt
index 7864ab546..fd0ee4aa1 100644
--- a/coverage/src/test/kotlin/org/rust/coverage/RsCoverageTest.kt
+++ b/coverage/src/test/kotlin/org/rust/coverage/RsCoverageTest.kt
@@ -147,11 +147,46 @@ class RsCoverageTest : RunConfigurationTestBase() {
 
         doTest(runTests = true) {
             toml("Cargo.toml", """
-            [package]
-            name = "hello"
-            version = "0.1.0"
-            authors = []
-        """)
+                [package]
+                name = "hello"
+                version = "0.1.0"
+                authors = []
+            """)
+
+            dir("src") {
+                rust("lib.rs", """
+                    fn foo() {                      // Hits: 2
+                        println!("Hello, world!");  // Hits: 2
+                    }                               // Hits: 2
+
+                    #[test]
+                    fn test1() {                    // Hits: 2
+                        foo();                      // Hits: 1
+                    }                               // Hits: 2
+
+                    #[test]
+                    fn test2() {                    // Hits: 2
+                        foo();                      // Hits: 1
+                    }                               // Hits: 2
+                """)
+            }
+        }
+    }
+
+    fun `test proc macro tests`() {
+        if (SystemInfo.isWindows) return // https://github.com/mozilla/grcov/issues/462
+
+        doTest(runTests = true) {
+            toml("Cargo.toml", """
+                [package]
+                name = "hello"
+                version = "0.1.0"
+                authors = []
+                
+                [lib]
+                proc-macro = true
+            """)
+
             dir("src") {
                 rust("lib.rs", """
                     fn foo() {                      // Hits: 2
@@ -172,6 +207,26 @@ class RsCoverageTest : RunConfigurationTestBase() {
         }
     }
 
+    fun `test panic`() = doTest {
+        toml("Cargo.toml", """
+            [package]
+            name = "hello"
+            version = "0.1.0"
+            authors = []
+        """)
+
+        dir("src") {
+            rust("main.rs", """
+                fn main() {          // Hits: 1
+                    let x = 1;       // Hits: 1
+                    let y = 2;       // Hits: 1
+                    panic!("fail");  // Hits: 1
+                    let z = 3;
+                }
+            """)
+        }
+    }
+
     private fun doTest(runTests: Boolean = false, builder: FileTreeBuilder.() -> Unit) {
         buildProject(builder)