Технології
🇺🇸 США
Bun Rust rewrite: "codebase fails basic miri checks, allows for UB in safe rust"
oven-sh
/
bun
Public

AwesomeQubicopened 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
- Notifications You must be signed in to change notification settings
- Fork 4.5k
- Star 90.6k
Description
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 unavailableMetadata
Metadata
Assignees
No one assignedLabels
No labelsNo labelsType
No typeProjects
No projectsMilestone
No milestoneRelationships
None yetDevelopment
No branches or pull requestsIssue actions
Джерело
Читати оригінал
Поділитися
Схожі новини
Chud the Builder visibly disappointed as bond hits $1.25 million
Times of India — World
·
Технології
Джон Траволта расплакался на Каннах — и не потому, что что-то пошло не так
ITC.ua
·
Apple discounts iPhone in China ahead of annual 618 shopping festival
9to5Mac
·
Технології
Tesla годами скрывала отчеты об авариях Robotaxi — и теперь они стали публичными
ITC.ua
·