Skip to content

fix: tighten visibility and resolve clippy warnings#12964

Open
hardfist wants to merge 2 commits intomainfrom
fix/unnecessary-pub-clippy
Open

fix: tighten visibility and resolve clippy warnings#12964
hardfist wants to merge 2 commits intomainfrom
fix/unnecessary-pub-clippy

Conversation

@hardfist
Copy link
Contributor

@hardfist hardfist commented Feb 6, 2026

Summary

  • tighten unnecessary Rust visibility (pub -> pub(crate) / pub(super) / private) across the workspace
  • enable unreachable_pub in workspace Rust lints so this is checked continuously
  • fix visibility/export regressions introduced during bulk visibility cleanup
  • add/fix MF benchmark target setup so --all-targets can be linted

Validation

  • cargo clippy --workspace --all-targets -- -W unreachable_pub -D warnings

Copilot AI review requested due to automatic review settings February 6, 2026 05:07
@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Feb 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request tightens Rust visibility modifiers across the workspace to reduce unnecessary public API surface and resolve clippy warnings. The changes convert pub to pub(crate), pub(super), or private visibility where appropriate, while also enabling the unreachable_pub lint in workspace configuration.

Changes:

  • Systematically reduced visibility from pub to pub(crate) or pub(super) across ~100+ files
  • Added unreachable_pub lint to workspace Cargo.toml to enforce visibility constraints
  • Fixed a visibility regression by adding Layered to rspack_tracing exports
  • Added benchmark target setup for rspack_plugin_mf with criterion2 dependency

Reviewed changes

Copilot reviewed 266 out of 267 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Cargo.toml Added unreachable_pub = "warn" workspace lint
Cargo.lock Added criterion2 dependency for mf plugin benchmarks
crates/rspack_tracing/src/lib.rs Added Layered to public exports to fix regression
crates/rspack_binding_api/src/lib.rs Added #![allow(unreachable_pub)] for NAPI exports
crates/rspack_plugin_mf/Cargo.toml Added criterion2 dev-dependency
crates/rspack_plugin_mf/benches/optimizer_lock_bench.rs New benchmark file
xtask/* Changed visibility to pub(crate) for command structs
crates/rspack_watcher/* Changed visibility to pub(crate) for internal modules
crates/rspack_storage/* Changed visibility to pub(crate) and pub(super) for internal types
crates/rspack_tools/* Changed visibility to pub(crate) for comparison utilities
crates/rspack_plugin_/ Changed visibility to pub(crate) for internal modules
crates/rspack_core/* Changed visibility to pub(crate) and pub(super) for internal types
Various test files Changed visibility to pub(crate) for test helpers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-5k 2.7 MB 0
react-1k 825.4 KB 0
ui-components 2.2 MB 0
rome 984.2 KB 0

Generated by Rsdoctor GitHub Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

📦 Binary Size-limit

Comparing 8f186d7 to docs: remove experimental outputModule configuration (#12952) by neverland

🙈 Size remains the same at 48.56MB

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 6, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing fix/unnecessary-pub-clippy (8f186d7) with main (a065139)

Summary

✅ 16 untouched benchmarks
⏩ 1 skipped benchmark1

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant