UK | EN |
LIVE
Технології 🇺🇸 США

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

Hacker News ndiddy 0 переглядів 2 хв читання
/ bun Public all of rust codebase: This codebase fails even the most basic miri checks, allows for UB in safe rust #30719New issueCopy linkNew issueCopy linkOpen#30728Openall of rust codebase: This codebase fails even the most basic miri checks, allows for UB in safe rust#30719#30728Copy link@AwesomeQubic

Description

@AwesomeQubicAwesomeQubicopened on May 14, 2026Issue body actionserror: Undefined Behavior: constructing invalid value of type &[u8]: encountered a dangling reference (0x20933[noalloc] has no provenance) --> src/main.rs:97:18 | 97 | unsafe { core::slice::from_raw_parts(ptr as *const u8, self.len()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information = note: stack backtrace: 0: PathString::slice at src/main.rs:97:18: 97:75 1: main at src/main.rs:130:22: 130:34

code:

fn main() { let test = Box::new(*b"Hello World"); let init = PathString::init(&*test); drop(test); println!("{:?}", init.slice()); }

Please consider not vibe coding rust as AIs are not good at writing Rust and also hire a real rust dev

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labelsNo labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        Поділитися

        Схожі новини