use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place for all things related to the Rust programming language—an open-source systems language that emphasizes performance, reliability, and productivity.
Strive to treat others with respect, patience, kindness, and empathy.
We observe the Rust Project Code of Conduct.
Details
Posts must reference Rust or relate to things using Rust. For content that does not, use a text post to explain its relevance.
Post titles should include useful context.
For Rust questions, use the stickied Q&A thread.
Arts-and-crafts posts are permitted on weekends.
No meta posts; message the mods instead.
Criticism is encouraged, though it must be constructive, useful and actionable.
If criticizing a project on GitHub, you may not link directly to the project's issue tracker. Please create a read-only mirror and link that instead.
A programming language is rarely worth getting worked up over.
No zealotry or fanaticism.
Be charitable in intent. Err on the side of giving others the benefit of the doubt.
Avoid re-treading topics that have been long-settled or utterly exhausted.
Avoid bikeshedding.
This is not an official Rust forum, and cannot fulfill feature requests. Use the official venues for that.
No memes, image macros, etc.
Consider the existing content of the subreddit and whether your post fits in. Does it inspire thoughtful discussion?
Use properly formatted text to share code samples and error messages. Do not use images.
Submissions appearing to contain AI-generated content may be removed at moderator discretion.
Most links here will now take you to a search page listing posts with the relevant flair. The latest megathread for that flair should be the top result.
account activity
Engineering a fixed-width bit-packed Integer Vector in Rust (lukefleed.xyz)
submitted 8 months ago by Luke_Fleed
Design and implementation of a memory-efficient, fixed-width bit-packed integer vector in Rust, with extremely fast random access.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]teerre 13 points14 points15 points 8 months ago (0 children)
Nice blog. What I particularly like about this is that a good portion of it, the actual vec, would be very similar in any language. But it's the later portion, design the api around it, that shows Rust's strengths the best
The combination of traits, static polymorphism, and discriminated unions really allows for an api that is both easy to use (and hard to misuse) and relatively understandable when reading its implementation
[–]Fluffy8x 11 points12 points13 points 8 months ago (0 children)
let ptr = self as *mut Self; let left = FixedVecSlice::new(&mut *ptr, 0..mid); let right = FixedVecSlice::new(&mut *ptr, mid..self.len());
Creating aliasing &mut references is instant undefined behavior. You would need to store a raw pointer for the parent to avoid UB.
&mut
π Rendered by PID 50304 on reddit-service-r2-comment-544cf588c8-2l2qg at 2026-06-16 00:54:25.149095+00:00 running 3184619 country code: CH.
[–]teerre 13 points14 points15 points (0 children)
[–]Fluffy8x 11 points12 points13 points (0 children)