rust-lang / rust-lang/rust

compiletest: FileCheck-based tests conflate FileCheck prefixes with compiletest revisions

Open
#134,510 20 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-compiletest A-testsuite C-cleanup E-hard E-tedious T-bootstrap T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Auto-registering revision names as check prefix is a bit sketchy, and that having to pass --allow-unused-prefix is an unfortunate side-effect of not knowing whether the test author actually wanted revision-specific check prefixes or not.

-- https://github.com/rust-lang/rust/pull/134463#discussion_r1890184927

With the current scheme where compiletest //@ revisions imply FileCheck prefixes of the same names, we can't distinguish between whether the author wanted to:

  1. Use compiletest revisions but ONLY for compiletest directive purposes.
  2. Use compiletest revisions but ONLY for filecheck prefix purposes.
  3. Use compiletest revisions for BOTH purposes.

We might want to investigate splitting these orthogonal concepts and have something like //@ filecheck-prefixes: XXX register FileCheck prefixes separately.

Marked as E-hard as this will take quite a bit of investigation/design, and E-tedious as this probably involves updating a whole bunch of tests, and I don't have the bandwidth to mentor.

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.

Research direction

Start by investigating compiletest's current handling of //@ revisions and how those names become FileCheck prefixes. Review the linked discussion and representative tests to define the separate directive semantics, then identify the tests requiring updates. Done means the two concepts can be used independently without requiring --allow-unused-prefix as a workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.