-
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
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! |
compiletest: Isolate public APIs and minimize public surface area 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. - rust-lang#143827 r? jieyouxu
Rollup of 7 pull requests Successful merges: - #146568 (Port the implemention of SIMD intrinsics from Miri to const-eval) - #147373 (give a better example why `std` modules named like primitives are needed) - #147419 (bootstrap: add `Builder::rustc_cmd` that includes the lib path) - #147457 (specialize slice::fill to use memset when possible) - #147468 (Implement fs api set_times and set_times_nofollow) - #147489 (Prefer to use repeat_n over repeat().take()) - #147506 (compiletest: Isolate public APIs and minimize public surface area) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 12 pull requests Successful merges: - #146568 (Port the implemention of SIMD intrinsics from Miri to const-eval) - #147373 (give a better example why `std` modules named like primitives are needed) - #147419 (bootstrap: add `Builder::rustc_cmd` that includes the lib path) - #147420 (Add diagnostic items for `pub mod consts` of FP types) - #147457 (specialize slice::fill to use memset when possible) - #147467 (Fix double warnings on `#[no_mangle]`) - #147470 (Clarify how to remediate the panic_immediate_abort error) - #147480 (Do not invalidate CFG caches in CtfeLimit.) - #147481 (format: some small cleanup) - #147488 (refactor: Remove `LLVMRustInsertPrivateGlobal` and `define_private_global`) - #147489 (Prefer to use repeat_n over repeat().take()) - #147506 (compiletest: Isolate public APIs and minimize public surface area) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147506 - Zalathar:isolate, r=jieyouxu compiletest: Isolate public APIs and minimize public surface area 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. - #143827 r? jieyouxu
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