Skip to content

source-lints: add node_fs.rs to dead-code escape inventory - #36073

Merged
Jarred-Sumner merged 1 commit into
mainfrom
farm/37ad0e1a/source-lints-node-fs-inventory
Jul 27, 2026
Merged

source-lints: add node_fs.rs to dead-code escape inventory#36073
Jarred-Sumner merged 1 commit into
mainfrom
farm/37ad0e1a/source-lints-node-fs-inventory

Conversation

@robobun

@robobun robobun commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What

Adds src/runtime/node/node_fs.rs: 2 to the dead-code escape inventory so the dead-code-escapes source-lint passes again on main.

Why

#36067 (bfd1e92) renamed _cp_symlinkcp_symlink and _cp_open_dest_with_mkdircp_open_dest_with_mkdir, moving the dead-code suppression from the leading underscore (which the inventory regex does not match) to explicit #[cfg_attr(..., allow(dead_code))] attributes:

#[cfg_attr(any(windows, target_os = "macos"), allow(dead_code))]
fn cp_symlink(&mut self, ...) { ... }

#[cfg_attr(windows, allow(dead_code))]
fn cp_open_dest_with_mkdir(&mut self, ...) { ... }

Both functions are called from the Linux/FreeBSD arms of copy_single_file_sync (lines 8613, 8680, 8706, 8852, 8878) and are only dead on the platforms named in the predicate, so the escapes are legitimate per the test's own rules. The inventory file was simply not regenerated, and the GitHub Actions source-lints workflow has been failing on every main commit since:

(fail) #[allow(dead_code)] escapes > src/runtime/node/node_fs.rs (0)
error: src/runtime/node/node_fs.rs has 2 item-level #[allow(dead_code)] escapes, up from 0.

Failed runs: 30249533282 (bfd1e92), 30249969141, 30250537591, 30250867335.

How

Regenerated with bun ./test/internal/source-lints/dead-code-escapes.test.ts per the test's instructions.

Verification

$ bun test test/internal/source-lints/dead-code-escapes.test.ts
...
(pass) #[allow(dead_code)] escapes > src/runtime/node/node_fs.rs (2)
...
 26 pass
 0 fail

no test proof · iteration 0 · docs-only change; test-proof not applicable

#36067 renamed _cp_symlink/_cp_open_dest_with_mkdir and moved the
dead-code suppression from the underscore prefix to explicit
#[cfg_attr(..., allow(dead_code))] attributes. Both functions are live
on Linux/FreeBSD and dead on Windows (and macOS for cp_symlink), so the
escapes are legitimate, but the inventory was not regenerated and the
ratchet test has been failing on main since bfd1e92.

Regenerated with:
  bun ./test/internal/source-lints/dead-code-escapes.test.ts
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@robobun, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3e9e3a24-0c78-41cc-95a1-1778bca5c7a9

📥 Commits

Reviewing files that changed from the base of the PR and between 7c92467 and 2cc1be3.

📒 Files selected for processing (1)
  • test/internal/source-lints/dead-code-escape-limits.json

Comment @coderabbitai help to get the list of available commands.

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

LGTM — mechanical inventory regen to unbreak the source-lints workflow.

What was reviewed:

  • Confirmed node_fs.rs has exactly 2 item-level allow(dead_code) escapes, both platform-gated #[cfg_attr] on cp_symlink / cp_open_dest_with_mkdir.
  • Verified both functions are live on non-gated targets (called at lines 8613/8680/8706/8852/8878), so the escapes are legitimate rather than masking actual dead code.
  • Entry is alphabetically ordered between fs_events.rs and NodeHTTPResponse.rs.
Extended reasoning...

Overview

Single-line addition to test/internal/source-lints/dead-code-escape-limits.json, a generated inventory file that caps how many item-level #[allow(dead_code)] attributes each source file may contain. #36067 renamed two underscore-prefixed helpers in node_fs.rs and replaced the underscore-based suppression with explicit #[cfg_attr(..., allow(dead_code))], which the lint now counts. The inventory wasn't regenerated in that PR, so the source-lints GitHub Actions workflow has been red on main.

Security risks

None. This touches only a test-infrastructure JSON snapshot; no runtime code, no build config.

Level of scrutiny

Minimal. The file is machine-generated (bun ./test/internal/source-lints/dead-code-escapes.test.ts) and the diff matches what regeneration would produce. I independently grepped node_fs.rs and found exactly the two allow(dead_code) occurrences described, both cfg-gated to platforms where the callers are compiled out — the canonical legitimate case for this escape hatch.

Other factors

  • Alphabetical ordering is preserved.
  • The count (2) matches the actual grep count, so this isn't over-budgeting.
  • No prior reviewer comments to address; only a CodeRabbit rate-limit notice on the timeline.

@robobun

robobun commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator Author

CI build failure (no method named 'resume_' found for enum 'AnyResponse', all lanes) is a pre-existing main break from the same merge race that this PR cleans up after. Main builds #83211/#83215/#83219/#83224 all fail the same way. #36072 fixes the build; this PR fixes the source-lints inventory. The two are independent and both needed for main to go green.

This diff touches only a generated test-inventory JSON and cannot affect the Rust build.

@Jarred-Sumner
Jarred-Sumner merged commit 4eb6f99 into main Jul 27, 2026
22 of 36 checks passed
@Jarred-Sumner
Jarred-Sumner deleted the farm/37ad0e1a/source-lints-node-fs-inventory branch July 27, 2026 09:15
Jarred-Sumner pushed a commit that referenced this pull request Jul 27, 2026
## What

Adds `src/runtime/node/node_fs.rs: 2` to the dead-code escape inventory
so the `dead-code-escapes` source-lint passes again on main.

## Why

#36067 (bfd1e92) renamed `_cp_symlink` → `cp_symlink` and
`_cp_open_dest_with_mkdir` → `cp_open_dest_with_mkdir`, moving the
dead-code suppression from the leading underscore (which the inventory
regex does not match) to explicit `#[cfg_attr(..., allow(dead_code))]`
attributes:

```rust
#[cfg_attr(any(windows, target_os = "macos"), allow(dead_code))]
fn cp_symlink(&mut self, ...) { ... }

#[cfg_attr(windows, allow(dead_code))]
fn cp_open_dest_with_mkdir(&mut self, ...) { ... }
```

Both functions are called from the Linux/FreeBSD arms of
`copy_single_file_sync` (lines 8613, 8680, 8706, 8852, 8878) and are
only dead on the platforms named in the predicate, so the escapes are
legitimate per the test's own rules. The inventory file was simply not
regenerated, and the GitHub Actions `source-lints` workflow has been
failing on every main commit since:

```
(fail) #[allow(dead_code)] escapes > src/runtime/node/node_fs.rs (0)
error: src/runtime/node/node_fs.rs has 2 item-level #[allow(dead_code)] escapes, up from 0.
```

Failed runs: 30249533282 (bfd1e92), 30249969141, 30250537591,
30250867335.

## How

Regenerated with `bun
./test/internal/source-lints/dead-code-escapes.test.ts` per the test's
instructions.

## Verification

```
$ bun test test/internal/source-lints/dead-code-escapes.test.ts
...
(pass) #[allow(dead_code)] escapes > src/runtime/node/node_fs.rs (2)
...
 26 pass
 0 fail
```

<!-- robobun:evidence:begin -->

---

**no test proof** · iteration 0 · docs-only change; test-proof not
applicable

<!-- robobun:evidence:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants