-
Notifications
You must be signed in to change notification settings - Fork 13.8k
compiletest: Isolate public APIs and minimize public surface area #147506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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.
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in src/tools/compiletest cc @jieyouxu |
|
There was a problem hiding this 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?
/// 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>, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
if let Some(ref npm) = builder.config.npm { | ||
cmd.arg("--npm").arg(npm); | ||
} |
There was a problem hiding this comment.
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.
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
I'm pretty confident that @rustbot ready |
Thanks for double-checking! |
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
withpub(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-test
uses compiletest directives +TestProp
handling internals in a questionable way #143827r? jieyouxu