about summary refs log tree commit diff
path: root/src/libtest
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtest')
-rw-r--r--src/libtest/test_result.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libtest/test_result.rs b/src/libtest/test_result.rs
index bfa572c887a..5c975c6272b 100644
--- a/src/libtest/test_result.rs
+++ b/src/libtest/test_result.rs
@@ -40,7 +40,7 @@ pub fn calc_result<'a>(
             let maybe_panic_str = err
                 .downcast_ref::<String>()
                 .map(|e| &**e)
-                .or_else(|| err.downcast_ref::<&'static str>().map(|e| *e));
+                .or_else(|| err.downcast_ref::<&'static str>().copied());
 
             if maybe_panic_str.map(|e| e.contains(msg)).unwrap_or(false) {
                 TestResult::TrOk