Skip to content
HN On Hacker News ↗

all of rust codebase: This codebase fails even the most basic miri checks, allows for UB in safe rust

▲ 488 points 345 comments by ndiddy 1w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully human-written

1 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 113
PEAK AI % 1% · §1
Analyzed
May 15
backend: pangram/v3.3
Segments scanned
1 windows
avg 113 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 113 words · 1 segments analyzed

Human AI-generated
§1 Human · 1%

error: 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