Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit d0f08ab

Browse files
committed
Check stderr for an ICE message
rustdoc (and I believe cargo, perhaps some other tools as well) don't return 101 when they ICE, this will pick up those cases
1 parent ab23aea commit d0f08ab

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,23 @@ impl ICE {
4646
.current_dir(workdir.path())
4747
.output()?,
4848
};
49+
50+
let stdout = String::from_utf8_lossy(&output.stdout).to_string();
51+
let stderr = String::from_utf8_lossy(&output.stderr).to_string();
52+
4953
Ok(TestResult {
5054
ice: self,
5155
outcome: match output.status.code() {
56+
_ if stderr.contains("error: internal compiler error") => Outcome::ICEd,
5257
Some(0) => Outcome::NoError,
5358
Some(101) => Outcome::ICEd, // An ICE will cause an error code of 101
5459
// Bash uses 128+N for processes terminated by signal N
5560
Some(x) if x > 128 => Outcome::ICEd,
5661
Some(_) => Outcome::Errored,
5762
None => Outcome::ICEd, // If rustc receives a signal treat is as an ICE
5863
},
59-
stdout: String::from_utf8_lossy(&output.stdout).to_string(),
60-
stderr: String::from_utf8_lossy(&output.stderr).to_string(),
64+
stdout,
65+
stderr,
6166
})
6267
}
6368
}

0 commit comments

Comments
 (0)