]> git.lizzy.rs Git - rust.git/commitdiff
Update crates/expect/src/lib.rs
authorAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 27 Jun 2020 17:55:54 +0000 (19:55 +0200)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Sat, 27 Jun 2020 18:50:16 +0000 (20:50 +0200)
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
crates/expect/src/lib.rs

index 08d0eafdf9f25fcbe92caea9e530eabfd4d9693a..1a1302cec79130177a0f67a8eb5c3a1065bae057 100644 (file)
@@ -106,7 +106,7 @@ fn fail(expect: &Expect, expected: &str, actual: &str) {
         rt.help_printed = true;
 
         let help = if print_help { HELP } else { "" };
-        panic!(
+        println!(
             "\n
 error: expect test failed{}
   --> {}:{}:{}
@@ -122,7 +122,9 @@ fn fail(expect: &Expect, expected: &str, actual: &str) {
 ----
 ",
             updated, expect.file, expect.line, expect.column, help, expected, actual
-        )
+        );
+        // Use resume_unwind instead of panic!() to prevent a backtrace, which is unnecessary noise.
+        std::panic::resume_unwind(Box::new(()));
     }
 }