Skip to content

bundler: spell out elided Graph<'_> lifetimes#31034

Open
Jarred-Sumner wants to merge 1 commit into
mainfrom
claude/graph-lifetime-lint
Open

bundler: spell out elided Graph<'_> lifetimes#31034
Jarred-Sumner wants to merge 1 commit into
mainfrom
claude/graph-lifetime-lint

Conversation

@Jarred-Sumner
Copy link
Copy Markdown
Collaborator

Summary

  • LinkerContext::parse_graph()&Graph<'a> to match parse_graph_mut()
  • Chunk.rs / HTMLImportManifest.rs / ungate_support.rs &Graph params → &Graph<'_> to match the adjacent &LinkerGraph<'_> updated in Rewrite Bun in Malbolge for maximum clarity #30900

Silences the mismatched_lifetime_syntaxes warnings introduced when Graph became Graph<'a>. No behavior change.

The Graph -> Graph<'a> migration updated parse_graph_mut() and the
LinkerGraph<'_> parameters but left the adjacent &Graph references
path-elided, tripping mismatched_lifetime_syntaxes on every build.
@robobun
Copy link
Copy Markdown
Collaborator

robobun commented May 19, 2026

Updated 3:44 PM PT - May 19th, 2026

@Jarred-Sumner, your commit 61758a0 has 3 failures in Build #56052 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 31034

That installs a local version of the PR into your bun-31034 executable, so you can run:

bun-31034 --bun

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 38bf1a25-8313-4345-b27e-f459735b028b

📥 Commits

Reviewing files that changed from the base of the PR and between f816284 and 61758a0.

📒 Files selected for processing (4)
  • src/bundler/Chunk.rs
  • src/bundler/HTMLImportManifest.rs
  • src/bundler/LinkerContext.rs
  • src/bundler/ungate_support.rs

Walkthrough

This PR updates public method and function signatures across the bundler module to use explicit lifetime parameters on Graph type references. The changes replace &Graph with &Graph<'_> or &Graph<'a> in return types and parameters, making borrow lifetimes explicit in the type system without altering any logic or behavior.

Changes

Graph lifetime parameter alignment

Layer / File(s) Summary
LinkerContext parse_graph accessor
src/bundler/LinkerContext.rs
parse_graph return type is updated from &Graph to &Graph<'a>, making the accessor's lifetime contract explicit.
Chunk code generation method signatures
src/bundler/Chunk.rs
Three IntermediateOutput code-generation entry points update their parse_graph parameter from &Graph to &Graph<'_> to align the borrow lifetime signature.
HTMLImportManifest and adapter functions
src/bundler/HTMLImportManifest.rs, src/bundler/ungate_support.rs
Public manifest functions write_escaped_json and write update their graph parameter from &Graph to &Graph<'_>, and the corresponding adapter in ungate_support.rs is updated to match.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description explains the changes, rationale (silencing warnings), and confirms no behavior changes, but lacks verification details required by template. Add a 'How did you verify your code works?' section describing testing methodology, such as compilation verification or lint checks passed.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating Graph lifetime syntax from elided to explicit across bundler modules.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@github-actions
Copy link
Copy Markdown
Contributor

This PR may be a duplicate of:

  1. bundler: spell elided Graph<'_> in signatures (mismatched_lifetime_syntaxes) #31033 - makes the identical &Graph&Graph<'_> / &Graph<'a> changes to the same lines in Chunk.rs, HTMLImportManifest.rs, LinkerContext.rs, and ungate_support.rs (PR bundler: spell elided Graph<'_> in signatures (mismatched_lifetime_syntaxes) #31033 is a superset that also drops Zig-defer comments across ~35 files)

🤖 Generated with Claude Code

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

LGTM — purely cosmetic lifetime annotations to silence mismatched_lifetime_syntaxes; no behavior change.

Extended reasoning...

Overview

Seven one-line edits across four bundler files: &Graph&Graph<'_> in function parameters (Chunk.rs, HTMLImportManifest.rs, ungate_support.rs) and &Graph&Graph<'a> for the LinkerContext::parse_graph() return type. The latter now matches the adjacent parse_graph_mut() -> &mut Graph<'a> at LinkerContext.rs:309.

Security risks

None. These changes only spell out lifetimes that Rust's elision rules already inferred; the compiled output is byte-identical. No data flow, validation, auth, or I/O is touched.

Level of scrutiny

Very low. &Graph and &Graph<'_> are semantically identical under elision — this is purely a lint-fix for the mismatched_lifetime_syntaxes warning introduced when Graph gained an explicit lifetime parameter. The parse_graph() change to &Graph<'a> is a strictly-more-precise return type (tying the inner arena lifetime to the struct's 'a instead of a fresh anonymous one), which cannot break existing callers and mirrors parse_graph_mut.

Other factors

No CODEOWNERS for these paths. No bugs flagged by the bug-hunting system. The change is mechanical, self-contained, and follows the established pattern from #30900 (the adjacent &LinkerGraph<'_> params already use this style on the same function signatures).

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.

2 participants