Skip to content

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Oct 9, 2025

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-pub to 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 pub with pub(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.

r? jieyouxu

All APIs used from outside the compiletest library crate have been isolated to
the `cli` and `rustdoc_gui_test` modules, so no other items need to be publicly
exported.
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner 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) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Oct 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

jieyouxu is currently at their maximum review capacity.
They may take a while to respond.

Copy link
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, most of these are very nice cleanups. The enzyme change seems unexpected tho, could you double-check?

View changes since this review

Comment on lines +21 to +27
/// Subset of compiletest directive values that are actually used by
/// rustdoc-gui-test.
#[derive(Debug)]
pub struct RustdocGuiTestProps {
pub compile_flags: Vec<String>,
pub run_flags: Vec<String>,
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines -1977 to -1979
if let Some(ref npm) = builder.config.npm {
cmd.arg("--npm").arg(npm);
}
Copy link
Member

Choose a reason for hiding this comment

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

Remark: oh nice, I didn't realize this was rustdoc-gui-test-only.

@jieyouxu
Copy link
Member

jieyouxu commented Oct 9, 2025

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Zalathar
Copy link
Contributor Author

Zalathar commented Oct 9, 2025

I'm pretty confident that TestProps::has_enzyme is actually unused, and that it's Config::has_enzyme (which still exists) that is responsible for //@ needs-enzyme and //@ ignore-enzyme, so those should continue to work.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 9, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Oct 9, 2025

Thanks for double-checking!
@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 9, 2025

📌 Commit ce4699d has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors 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 Oct 9, 2025
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-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) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants