about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzachs18 <8355914+zachs18@users.noreply.github.com>2024-05-16 05:51:29 +0000
committerGitHub <noreply@github.com>2024-05-16 05:51:29 +0000
commita59d071e9caa140ddaff4a9e1b747dba0d95f0cd (patch)
tree8ac86db90019899220ee8b078071230bdab8f491
parent376a8c0ae5ad6cb8d0c5d6631874bdd3c950436f (diff)
downloadrust-a59d071e9caa140ddaff4a9e1b747dba0d95f0cd.tar.gz
rust-a59d071e9caa140ddaff4a9e1b747dba0d95f0cd.zip
Fix `for_loops_over_fallibles` hits in compiletest/src/json.rs
-rw-r--r--src/tools/compiletest/src/json.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs
index 10726b98420..29e8809e5bd 100644
--- a/src/tools/compiletest/src/json.rs
+++ b/src/tools/compiletest/src/json.rs
@@ -282,7 +282,7 @@ fn push_expected_errors(
 
     // Add notes for the backtrace
     for span in primary_spans {
-        for frame in &span.expansion {
+        if let Some(frame) = &span.expansion {
             push_backtrace(expected_errors, frame, file_name);
         }
     }
@@ -315,7 +315,7 @@ fn push_backtrace(
         });
     }
 
-    for previous_expansion in &expansion.span.expansion {
+    if let Some(previous_expansion) = &expansion.span.expansion {
         push_backtrace(expected_errors, previous_expansion, file_name);
     }
 }