Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"

Bun’s big Rust makeover is getting roasted as commenters ask if hype outran reality

TLDR: A bug report says Bun’s Rust rewrite still allows a serious kind of broken behavior, undercutting the big promise that the move would make things safer. Commenters are split between mocking the hype and defending it as a fixable first draft, with AI coding jokes and media-backlash energy everywhere.

The internet loves a dramatic launch, and Bun’s rushed rewrite in Rust is now getting the full comments-section treatment after a bug report claimed the new code can still do dangerous, broken things even in places that are supposed to be safer. In plain English: Bun’s team proudly moved part of the project to a language famous for preventing memory mistakes, and critics quickly found a case where the rewrite seems to trip over exactly that promise. That contrast is what set people off.

The sharpest reaction came from the brutally direct crowd: one poster basically begged the team to “please consider not vibe coding rust as AIs are not good at writing Rust and also hire a real rust dev.” Ouch. Others zoomed out and turned this into a media critique, saying flashy announcements always travel farther than quiet corrections, with one commenter lamenting the huge gap between the reach of “we rewrote it fast and safely” and the much smaller audience that will ever see the bug report on GitHub. But not everyone brought pitchforks. A more forgiving camp argued this was predictable growing pain, noting the stable version still exists in Zig and saying the bugs can be fixed over time. One even speculated the messy rewrite might become “precious training data” for future AI coding tools. And yes, there was classic comment-thread comedy too, like the deadpan hero who stepped in just to translate “UB” as “undefined behaviour” for baffled bystanders. In other words: part scandal, part coping, part meme fest.

Key Points

  • A GitHub issue claims Bun’s Rust rewrite fails a basic miri check and permits undefined behavior in safe Rust.
  • The report references `src/bun_core/string/PathString.rs` in the Bun repository, specifically lines 111–119.
  • The included diagnostic says an invalid `&[u8]` slice was constructed from a dangling reference with no provenance.
  • The backtrace identifies `PathString::slice` and an unsafe call to `core::slice::from_raw_parts` as the point where undefined behavior occurs.
  • A minimal example demonstrates initializing `PathString` from boxed data, dropping that data, and then calling `slice()`, which accesses freed memory.

Hottest takes

"please consider not vibe coding rust as AIs are not good at writing Rust and also hire a real rust dev" — article discussion
"There is a huge asymmetry between the reach of a big, flashy announcement ... and the relatively small reach of a correction" — dangerlibrary
"use it as precious training data for Rust capabilities" — stellalo
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.