Skip to content

Commit 65d1e8d

Browse files
committed
Hack compiletest to fix a random CI failure
1 parent 4a6d9de commit 65d1e8d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/tools/compiletest/src/read2.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,18 @@ impl ProcOutput {
110110
fn into_bytes(self) -> Vec<u8> {
111111
match self {
112112
ProcOutput::Full { bytes, .. } => bytes,
113-
ProcOutput::Abbreviated { mut head, skipped, tail } => {
113+
ProcOutput::Abbreviated { mut head, mut skipped, tail } => {
114+
let mut tail = &*tail;
115+
116+
// Skip over '{' at the start of the tail, so we don't later wrongfully consider this as json.
117+
// See <https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Weird.20CI.20failure/near/321797811>
118+
while tail.get(0) == Some(&b'{') {
119+
tail = &tail[1..];
120+
skipped += 1;
121+
}
122+
114123
write!(&mut head, "\n\n<<<<<< SKIPPED {} BYTES >>>>>>\n\n", skipped).unwrap();
115-
head.extend_from_slice(&tail);
124+
head.extend_from_slice(tail);
116125
head
117126
}
118127
}

0 commit comments

Comments
 (0)