]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/compiletest/src/read2.rs
Rollup merge of #106978 - mejrs:mir_build3, r=davidtwco
[rust.git] / src / tools / compiletest / src / read2.rs
index 7640e6517442881ca3089c9745b324e9860b1e29..a5dc6859732a3d2c5348fb8084e00e0afbd876a5 100644 (file)
@@ -110,9 +110,18 @@ fn extend(&mut self, data: &[u8], filter_paths_from_len: &[String]) {
     fn into_bytes(self) -> Vec<u8> {
         match self {
             ProcOutput::Full { bytes, .. } => bytes,
-            ProcOutput::Abbreviated { mut head, skipped, tail } => {
+            ProcOutput::Abbreviated { mut head, mut skipped, tail } => {
+                let mut tail = &*tail;
+
+                // Skip over '{' at the start of the tail, so we don't later wrongfully consider this as json.
+                // See <https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Weird.20CI.20failure/near/321797811>
+                while tail.get(0) == Some(&b'{') {
+                    tail = &tail[1..];
+                    skipped += 1;
+                }
+
                 write!(&mut head, "\n\n<<<<<< SKIPPED {} BYTES >>>>>>\n\n", skipped).unwrap();
-                head.extend_from_slice(&tail);
+                head.extend_from_slice(tail);
                 head
             }
         }