compiletest: Isolate public APIs and minimize public surface area#147506
Merged
bors merged 3 commits intorust-lang:masterfrom Oct 9, 2025
Merged
compiletest: Isolate public APIs and minimize public surface area#147506bors merged 3 commits intorust-lang:masterfrom
bors merged 3 commits intorust-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of my ongoing efforts to improve directive parsing, I would like to be able to make internal changes without worrying about whether they're going to break the rustdoc-gui-test tool. That tool currently uses compiletest as a dependency to help with directive parsing.
This PR therefore isolates all of compiletest's public APIs into two dedicated modules, one used by rustdoc-gui-test, and one used by the compiletest binary in
compiletest/src/bin/main.rs.All other modules (and crate-root items) are then made non-
pubto achieve the API isolation. Doing so reveals some unused items, which have been removed.(To reduce the amount of immediate textual churn, this PR does not comprehensively replace
pubwithpub(crate)throughout the whole crate; that could be done in a follow-up PR.)Ideally, rustdoc-gui-test would not depend on compiletest at all, but properly fixing that is out of scope for this PR.
src/tools/rustdoc-gui-testuses compiletest directives +TestProphandling internals in a questionable way #143827r? jieyouxu