Skip to content

Commit 7bd1ec4

Browse files
committed
Revert "Include compiler crashes in ICE defintion"
This reverts commit a3891cd.
1 parent cdd093e commit 7bd1ec4

File tree

1 file changed

+43
-36
lines changed

1 file changed

+43
-36
lines changed

Diff for: src/main.rs

+43-36
Original file line numberDiff line numberDiff line change
@@ -240,33 +240,39 @@ impl Config {
240240
status, stdout_utf8, stderr_utf8
241241
);
242242

243-
// for commit message:
244-
// no text but 101 https://github.com/rust-lang/rust/issues/21599
245-
// no text, signal https://github.com/rust-lang/rust/issues/13368
243+
let saw_ice = || -> bool { stderr_utf8.contains("error: internal compiler error") };
246244

247-
const SUCCESS: Option<i32> = Some(0);
248-
const ICE: Option<i32> = Some(101);
249-
250-
let input = (self.output_processing_mode(), status.code());
245+
let input = (self.output_processing_mode(), status.success());
251246
let result = match input {
252-
(OutputProcessingMode::RegressOnErrorStatus, SUCCESS) => TestOutcome::Baseline,
253-
(OutputProcessingMode::RegressOnErrorStatus, _) => TestOutcome::Regressed,
254-
255-
(OutputProcessingMode::RegressOnSuccessStatus, SUCCESS) => TestOutcome::Regressed,
256-
(OutputProcessingMode::RegressOnSuccessStatus, _) => TestOutcome::Baseline,
247+
(OutputProcessingMode::RegressOnErrorStatus, true) => TestOutcome::Baseline,
248+
(OutputProcessingMode::RegressOnErrorStatus, false) => TestOutcome::Regressed,
257249

258-
(OutputProcessingMode::RegressOnIceAlone, ICE) => TestOutcome::Regressed,
259-
(OutputProcessingMode::RegressOnIceAlone, None) => TestOutcome::Regressed,
260-
(OutputProcessingMode::RegressOnIceAlone, _) => TestOutcome::Baseline,
250+
(OutputProcessingMode::RegressOnSuccessStatus, true) => TestOutcome::Regressed,
251+
(OutputProcessingMode::RegressOnSuccessStatus, false) => TestOutcome::Baseline,
261252

262-
(OutputProcessingMode::RegressOnNotIce, ICE) => TestOutcome::Baseline,
263-
(OutputProcessingMode::RegressOnNotIce, None) => TestOutcome::Baseline,
264-
(OutputProcessingMode::RegressOnNotIce, _) => TestOutcome::Regressed,
253+
(OutputProcessingMode::RegressOnIceAlone, _) => {
254+
if saw_ice() {
255+
TestOutcome::Regressed
256+
} else {
257+
TestOutcome::Baseline
258+
}
259+
}
260+
(OutputProcessingMode::RegressOnNotIce, _) => {
261+
if saw_ice() {
262+
TestOutcome::Baseline
263+
} else {
264+
TestOutcome::Regressed
265+
}
266+
}
265267

266-
(OutputProcessingMode::RegressOnNonCleanError, SUCCESS) => TestOutcome::Regressed,
267-
(OutputProcessingMode::RegressOnNonCleanError, ICE) => TestOutcome::Regressed,
268-
(OutputProcessingMode::RegressOnNonCleanError, None) => TestOutcome::Regressed,
269-
(OutputProcessingMode::RegressOnNonCleanError, _) => TestOutcome::Baseline,
268+
(OutputProcessingMode::RegressOnNonCleanError, true) => TestOutcome::Regressed,
269+
(OutputProcessingMode::RegressOnNonCleanError, false) => {
270+
if saw_ice() {
271+
TestOutcome::Regressed
272+
} else {
273+
TestOutcome::Baseline
274+
}
275+
}
270276
};
271277
debug!(
272278
"default_outcome_of_output: input: {:?} result: {:?}",
@@ -311,27 +317,27 @@ enum OutputProcessingMode {
311317
RegressOnSuccessStatus,
312318

313319
/// `RegressOnIceAlone`: Marks test outcome as `Regressed` if and only if
314-
/// the `rustc` process crashes or reports an interal compiler error (ICE)
315-
/// has occurred. This covers the use case for when you want to bisect to
316-
/// see when an ICE was introduced pon a codebase that is meant to produce a
317-
/// clean error.
320+
/// the `rustc` process issues a diagnostic indicating that an internal
321+
/// compiler error (ICE) occurred. This covers the use case for when you
322+
/// want to bisect to see when an ICE was introduced pon a codebase that is
323+
/// meant to produce a clean error.
318324
///
319325
/// You explicitly opt into this seting via `--regress=ice`.
320326
RegressOnIceAlone,
321327

322328
/// `RegressOnNotIce`: Marks test outcome as `Regressed` if and only if
323-
/// the `rustc` process does not crash or report that an internal compiler
324-
/// error (ICE) has occurred. This covers the use case for when you want to
325-
/// bisect to see when an ICE was fixed.
329+
/// the `rustc` process does not issue a diagnostic indicating that an
330+
/// internal compiler error (ICE) occurred. This covers the use case for
331+
/// when you want to bisect to see when an ICE was fixed.
326332
///
327333
/// You explicitly opt into this setting via `--regress=non-ice`
328334
RegressOnNotIce,
329335

330336
/// `RegressOnNonCleanError`: Marks test outcome as `Baseline` if and only
331-
/// if the `rustc` process reports error status that is not an internal
332-
/// compiler error (ICE). This is the use case if the regression is a case
333-
/// where an ill-formed program has stopped being properly rejected by the
334-
/// compiler.
337+
/// if the `rustc` process reports error status and does not issue any
338+
/// diagnostic indicating that an internal compiler error (ICE) occurred.
339+
/// This is the use case if the regression is a case where an ill-formed
340+
/// program has stopped being properly rejected by the compiler.
335341
///
336342
/// (The main difference between this case and `RegressOnSuccessStatus` is
337343
/// the handling of ICE: `RegressOnSuccessStatus` assumes that ICE should be
@@ -346,10 +352,11 @@ impl OutputProcessingMode {
346352
fn must_process_stderr(&self) -> bool {
347353
match self {
348354
OutputProcessingMode::RegressOnErrorStatus
349-
| OutputProcessingMode::RegressOnSuccessStatus
350-
| OutputProcessingMode::RegressOnNonCleanError
355+
| OutputProcessingMode::RegressOnSuccessStatus => false,
356+
357+
OutputProcessingMode::RegressOnNonCleanError
351358
| OutputProcessingMode::RegressOnIceAlone
352-
| OutputProcessingMode::RegressOnNotIce => false,
359+
| OutputProcessingMode::RegressOnNotIce => true,
353360
}
354361
}
355362
}

0 commit comments

Comments
 (0)