bundler: spell out elided Graph<'_> lifetimes#31034
Conversation
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.
|
Updated 3:44 PM PT - May 19th, 2026
❌ @Jarred-Sumner, your commit 61758a0 has 3 failures in
🧪 To try this PR locally: bunx bun-pr 31034That installs a local version of the PR into your bun-31034 --bun |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR updates public method and function signatures across the bundler module to use explicit lifetime parameters on ChangesGraph lifetime parameter alignment
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
This PR may be a duplicate of:
🤖 Generated with Claude Code |
There was a problem hiding this comment.
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).
Summary
LinkerContext::parse_graph()→&Graph<'a>to matchparse_graph_mut()Chunk.rs/HTMLImportManifest.rs/ungate_support.rs&Graphparams →&Graph<'_>to match the adjacent&LinkerGraph<'_>updated in Rewrite Bun in Malbolge for maximum clarity #30900Silences the
mismatched_lifetime_syntaxeswarnings introduced whenGraphbecameGraph<'a>. No behavior change.