Enable unreachable_pub lint in xtask - #1140
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request enables the rust.unreachable_pub lint for the xtask crate by removing it from the exclusion list in scripts/sync.sh and adding the lint configuration to crates/xtask/Cargo.toml. Consequently, public visibility modifiers (pub) have been restricted to crate-level visibility (pub(crate)) for various functions and constants across crates/xtask/src/footprint.rs, crates/xtask/src/opentitan.rs, and crates/xtask/src/textreview.rs. There are no review comments, so I have no feedback to provide.
|
@googlebot I signed it! |
1 similar comment
|
@googlebot I signed it! |
71bbb2e to
c96f293
Compare
Removes xtask from the unreachable_pub exclusion list in scripts/sync.sh, adds the lint to crates/xtask/Cargo.toml, and restricts binary-internal items to pub(crate). Continues the incremental work of google#565 (following google#1139 which enabled the lint for the interpreter). Verified on host: cargo check, cargo clippy, and cargo fmt --check all pass with no warnings.
c96f293 to
68364f5
Compare
|
Hi @ia0, hope you had a good vacation, and thanks for the review! Quick heads up: the earlier sync failure was just the rustup submodule drift, not anything in this change. I've rebased onto the latest main (past #1144, which bumped rustup to 1.29.1), so that's sorted now. The lints regeneration produced no diff, which confirms the Cargo.toml edit matches what sync.sh generates. It looks like the fork PR is waiting on a maintainer to approve the workflow run before CI can go again. Whenever you get a chance to kick it off, it should be green. Thanks! |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request enables the rust.unreachable_pub lint for the xtask crate by updating crates/xtask/Cargo.toml and removing xtask from the exclusion list in scripts/sync.sh. As a result, several public functions and constants in footprint.rs, opentitan.rs, and textreview.rs have had their visibility restricted to pub(crate). There are no review comments, and I have no feedback to provide.
What
Enables the
rust.unreachable_publint for thextaskcrate:xtaskfrom theunreachable_pubexclusion list inscripts/sync.sh.rust.unreachable_pub = "warn"tocrates/xtask/Cargo.toml(matching the orderingsync.shgenerates).pub(crate)acrossfootprint.rs,opentitan.rs, andtextreview.rs.Why
Continues the incremental work of #565 ("Fix all lints currently disabled in scripts/sync.sh"), following #1139 which enabled the same lint for the interpreter.
xtaskis a host binary, so none of these items were ever reachable outside the crate.Verification
Ran on host (
aarch64-apple-darwin):cargo check— clean, 0 warningscargo clippy— cleancargo fmt --check— cleanNote: the full Linux CI suite (
scripts/ci.sh) was not run locally.