Repository navigation
Conversation
bun_core::output::pretty_errorln (the function) has no caller. Its last callers went away in #46021. The macro pretty_errorln! stays. The clippy.toml row that names the function goes with it. Without the function the row resolves to the macro and clippy warns "expected a function, found a macro".
|
Updated 10:55 AM PT - Oct 27th, 2026
✅ @robobun, your commit 4353d5ce5cda85c4899a206cdf4cace1cae7d030 passed in 🧪 To try this PR locally: bunx bun-pr 47084That installs a local version of the PR into your bun-47084 --bun |
|
Status: ready for review.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Remove function API src/bun_core/output.rs, clippy.toml |
The public pretty_errorln function and its disallowed-method entry were removed. |
Suggested reviewers: alii
Priority:
Merge Risk: 
Minimal · up to 4353d
-
The removal has no identified impact on current repository callers and is ready to merge after normal checks.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title names the removed item and its scope: the function form of
pretty_errorlninbun_core. The diff removes that function and itsclippy.tomlentry, so the title matches the main change. It does not mention theclippy.tomledit, which is a minor omission.
Full details: Description check
-
Explanation
The description follows the template's intent. It states the problem, the fix, and how the change was verified (
bun bd,bun run rust:check-all,cargo check --workspace --all-targets,bun run rust:clippy, and three named test files). It also gives background, downsides, and a notes section. The template headingsWhat does this PR do?andHow did you verify your code works?are not used as written. The verification section lists commands and results, so the content is present under different headings.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
LGTM — straightforward dead-code removal with no behaviour change.
What was reviewed:
- Searched the whole checkout for function-form callers (
pretty_errorln(andoutput::pretty_errorln) — none remain; the only hit is apretty_errorln!macro call in src/runtime/server/HTMLBundle.rs. - The
use bun_core::{..., pretty_errorln}imports in src/output/lib.rs and src/runtime/cli/*.rs, anduse crate::{pretty, pretty_error, pretty_errorln}at src/bun_core/output.rs:15, all resolve to the#[macro_export]macro (defined at output.rs:2153), which is still used inside output.rs (warn/debug_warnat lines 174/183), so nothing becomes orphaned. - Removing the clippy.toml
disallowed-methodsrow is required, not optional: with the function gone the path would resolve to the macro and clippy would warn on the config. - src/CLAUDE.md only documents the macro form, so no docs describe the removed state.
Extended reasoning...
The change deletes the unused pub fn pretty_errorln function form from src/bun_core/output.rs and the matching disallowed-methods entry in clippy.toml; 14 lines removed, nothing added. It touches no security-sensitive surface. A repo-wide search confirms no remaining function-form callers and that every remaining pretty_errorln name resolves to the retained macro, and neither file is covered by .github/CODEOWNERS. The bug hunt exited on dry_streak with no findings, and the three ruled-out candidates all reduce to the same verified fact that only the macro is referenced.
Problem
bun_core::output::pretty_errorlnhas no caller. Its last callers went away in Hardening: fix crashes across the runtime, bundler, dev server, shell and CLI #46021 (9b4284f).dead_code = "deny"does not report a barepub fn. The macropretty_errorln!has the same name, so a name search finds mostly macro calls.Fix
clippy.tomlrow that names it: 14 lines in 2 files. Narrow crate-internal Rust visibility across all targets and delete the code it proves dead #36184 did the same forpretty_error,noteanddebug.uselines that import the macro.bun bd,bun run rust:check-all(12 targets),cargo check --workspace --all-targets,bun run rust:clippy.Background
bun_core::outputhas a macro form and a function form. The macro rewrites<tag>markup at compile time.clippy.tomllists the function form underdisallowed-methods.expected a function, found a macro.Downsides
Behaviour change: none
Notes
Removed
pub fn pretty_errorln(payload: impl PrettyFmtInput)insrc/bun_core/output.rs, with its doc comment and#[inline].bun_core::output::pretty_errorlnrow ofdisallowed-methodsinclippy.toml.git grep pretty_errorln, without the lines that containpretty_errorln!, finds onlyuselines, themacro_rules!line and one comment.rgoverbuild/debug/codegenfinds nothing.cargo clippy -p bun_ptr --no-depsprintsclippy.toml:28:12: warning: expected a function, found a macrowhen the row stays. It prints no such line on this branch.What earlier sweeps said about this item
clippy.tomlnames it. This change removes the row with the function.Open pull requests
pretty_errorln(.git merge-tree) gives conflicts in each.clippy.tomlorsrc/bun_core/output.rs. A trial merge shows that this branch adds a conflict to none of them.Found dead in this run, and left alone
scid_lenanddelay_onclose(http: consolidate the open fetch, Bun.serve, node:http, node:http2 and HTTP/3 pull requests #46528).JSCommonJSModule::createwith aWTF::Stringkey (Route require() through an overridden Module._load #33026,NodeModuleModule.cpp:818), as Remove dead code from bun_lint #47028 recorded.PerformanceResourceTimingandPerformanceServerTiming(create, the constructors,populateServerTiming). Nothing can construct either class. Remove dead code: 92 trait impls nothing calls, across 29 crates #39795, Remove dead code from the bake client, uSockets, uWS HTTP/2, uws_sys, and the CI pipeline script #43976 and Remove dead code from bun_lint, bun_sema, BunProcess.cpp, and NodeDirent.cpp #45764 ask if the cluster stays for a later implementation or shrinks to the two global constructors.ncrypto::ECDSASigPointer,ECGroupPointerandECPointPointer(Remove dead code from the WebSocket client, ncrypto, bun_core, and misc JSC bindings #40413).impl Display for CowSliceZ<u8, Z>(Remove dead code: 49 trait impls nothing uses, across 12 crates #43664).How the candidates were found
-Wl,--gc-sections,--print-gc-sections, with each discarded function mapped to its source definition.cargo checkfor linux, windows and macos, then the unit tests, put all but two back.-Wunused-function -Wunused-template -Wunused-member-function -Wunused-macrosover 603 translation units (20 did not parse alone). Each real hit is in an open pull request.tsc --noUnusedLocalsoversrc/js.Rejected from the self-review
disallowed-methodsrows that name no function, and a build without-Wno-unused-function. Each is a separate change.Tests, debug build of this branch
test/cli/bun.test.ts,test/cli/run/commonjs-invalid.test.ts,test/cli/run/run-eval.test.ts: all pass.