Skip to content

Enable unreachable_pub lint in xtask - #1140

Merged
ia0 merged 2 commits into
google:mainfrom
56steve:enable-unreachable-pub-xtask
Sep 2, 2026
Merged

Enable unreachable_pub lint in xtask#1140
ia0 merged 2 commits into
google:mainfrom
56steve:enable-unreachable-pub-xtask

Conversation

@56steve

@56steve 56steve commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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
Contributor Author

@googlebot I signed it!

1 similar comment
@56steve

56steve commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

@googlebot I signed it!

@56steve
56steve force-pushed the enable-unreachable-pub-xtask branch from 71bbb2e to c96f293 Compare August 26, 2026 07:56
ia0
ia0 previously approved these changes Sep 2, 2026
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 c96f293 to 68364f5 Compare September 2, 2026 13:35
@56steve

56steve commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

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!

@ia0

ia0 commented Sep 2, 2026

Copy link
Copy Markdown
Member

/gemini review

@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 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.

@ia0 ia0 added crate:xtask Modifies the maintainers CLI for:maintainability Improves maintainers life labels Sep 2, 2026
@ia0
ia0 merged commit eecd93b into google:main Sep 2, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crate:xtask Modifies the maintainers CLI for:maintainability Improves maintainers life

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants