Skip to content

Forbid *-pass and *-fail directives in tests/crashes#155712

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Zalathar:crashes
Apr 24, 2026
Merged

Forbid *-pass and *-fail directives in tests/crashes#155712
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Zalathar:crashes

Conversation

@Zalathar
Copy link
Copy Markdown
Member

Crash tests are always expected to crash during compilation, so there is no sensible meaning for specifying a pass expectation or a run-fail expectation in a crash test.

It could conceivably be useful to use failure expectations to specify whether a crash test requires codegen in order to crash, but currently none of the crash tests try to do that. If that functionality is desired in the future, we can always look into re-adding it after the internals of pass/fail expectations have been cleaned up a bit.


After this change, pass/fail directives are only allowed in UI tests, which should make it easier to overhaul and simplify their implementation.

r? jieyouxu

Crash tests are always expected to crash during compilation, so there is no
sensible meaning for specifying a pass/fail expectation in a crash test.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 24, 2026

Some changes occurred in src/tools/compiletest

cc @jieyouxu

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @tshepang

@rustbot rustbot added the A-compiletest Area: The compiletest test runner label Apr 24, 2026
@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 24, 2026
Copy link
Copy Markdown
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks
r? me @bors r+ rollup

View changes since this review

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 24, 2026

📌 Commit bcb1af0 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 24, 2026
Forbid `*-pass` and `*-fail` directives in tests/crashes

Crash tests are always expected to crash during compilation, so there is no sensible meaning for specifying a pass expectation or a run-fail expectation in a crash test.

It could conceivably be useful to use failure expectations to specify whether a crash test requires codegen in order to crash, but currently none of the crash tests try to do that. If that functionality is desired in the future, we can always look into re-adding it after the internals of pass/fail expectations have been cleaned up a bit.

---

After this change, pass/fail directives are only allowed in UI tests, which should make it easier to overhaul and simplify their implementation.

r? jieyouxu
rust-bors Bot pushed a commit that referenced this pull request Apr 24, 2026
Rollup of 9 pull requests

Successful merges:

 - #155684 (Generalize IO Traits for `Arc<T>` where `&T: IoTrait`)
 - #155081 (Move and clean up some ui test)
 - #155379 (Avoid query cycles in DataflowConstProp)
 - #155663 (Eliminate `CrateMetadataRef`.)
 - #155669 (Add `Sender` diagnostic item for `std::sync::mpsc::Sender`)
 - #155698 (Syntactically reject tuple index shorthands in struct patterns to fix a correctness regression)
 - #155703 (Remove myself as a maintainer of `wasm32-wasip1-threads`)
 - #155706 (Remove `AttributeLintKind` variants - part 7)
 - #155712 (Forbid `*-pass` and `*-fail` directives in tests/crashes)
rust-timer added a commit that referenced this pull request Apr 24, 2026
Rollup merge of #155712 - Zalathar:crashes, r=jieyouxu

Forbid `*-pass` and `*-fail` directives in tests/crashes

Crash tests are always expected to crash during compilation, so there is no sensible meaning for specifying a pass expectation or a run-fail expectation in a crash test.

It could conceivably be useful to use failure expectations to specify whether a crash test requires codegen in order to crash, but currently none of the crash tests try to do that. If that functionality is desired in the future, we can always look into re-adding it after the internals of pass/fail expectations have been cleaned up a bit.

---

After this change, pass/fail directives are only allowed in UI tests, which should make it easier to overhaul and simplify their implementation.

r? jieyouxu
@rust-bors rust-bors Bot merged commit a2622ef into rust-lang:main Apr 24, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 24, 2026
@Zalathar Zalathar deleted the crashes branch April 24, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants