rust-lang / rust-lang/rust

compiletest: Detect unused auxiliary crates?

Open
#133,914 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

There are some auxiliary crates that are unused in the tests directory. I think it would be nice if compiletest could detect these and complain about them in some way.

This might be difficult due to ignored tests, or tests that are otherwise not run, which don't load enough information to know which auxiliary tests are used.

If it ends up being technically challenging, perhaps someone could just manually go through and clean up the orphans?
I've been intending to do that, but just haven't been able to make the time.

Example: https://github.com/rust-lang/rust/blob/master/tests/ui/auxiliary/default-ty-param-cross-crate-crate.rs

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 reading the compiletest implementation and inspecting tests/ui/auxiliary/default-ty-param-cross-crate-crate.rs, the orphan named in the issue. Trace how auxiliary crates are discovered and how ignored or unrun tests are represented. Done means either compiletest reliably reports unused auxiliaries or the identified orphan files are cleaned up, with behavior checked against the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.