Skip to content

Enable unreachable_pub lint in xtask - #1140

Open
56steve wants to merge 1 commit into
google:mainfrom
56steve:enable-unreachable-pub-xtask
Open

Enable unreachable_pub lint in xtask#1140
56steve wants to merge 1 commit into
google:mainfrom
56steve:enable-unreachable-pub-xtask

Conversation

@56steve

@56steve 56steve commented Aug 26, 2026

Copy link
Copy Markdown

What

Enables the rust.unreachable_pub lint for the xtask crate:

  • Removes xtask from the unreachable_pub exclusion list in scripts/sync.sh.
  • Adds rust.unreachable_pub = "warn" to crates/xtask/Cargo.toml (matching the ordering sync.sh generates).
  • Restricts binary-internal items to pub(crate) across footprint.rs, opentitan.rs, and textreview.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. xtask is 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 warnings
  • cargo clippy — clean
  • cargo fmt --check — clean

Note: the full Linux CI suite (scripts/ci.sh) was not run locally.

@56steve
56steve requested a review from ia0 as a code owner August 26, 2026 07:30
@google-cla

google-cla Bot commented Aug 26, 2026

Copy link
Copy Markdown

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@56steve

56steve commented Aug 26, 2026

Copy link
Copy Markdown
Author

@googlebot I signed it!

1 similar comment
@56steve

56steve commented Aug 26, 2026

Copy link
Copy Markdown
Author

@googlebot I signed it!

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.
@56steve
56steve force-pushed the enable-unreachable-pub-xtask branch from 71bbb2e to c96f293 Compare August 26, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant