rust-lang / rust-lang/rust

compiletest: warn/error on redundant `check-fail` directives

Open
#130,742 6 comments 0 reactions 1 assignee View on GitHub

@jieyouxu is already working on this.

Since Oct 1, 2025.

A-compiletest C-enhancement E-medium T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

check-fail here is redundant

Originally posted by @compiler-errors in https://github.com/rust-lang/rust/pull/130718#discussion_r1770625658

Some test suites have a default test behavior, like //@ check-fail, in which case specifying that explicitly in the test is redundant and useless noise. When compiletest directive handling is worked, we should warn or error on redundant directives like these and also explain why it's redundant, e.g. "ui test mode is check-fail by default".

Remark: this check should not be added before reworking how compiletest directives are handled as it's not just one test suite or directive.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.