r/rust • u/noop_noob • 5h ago
ποΈ news Rust 1.99.1
blog.rust-lang.orgPrevious discussion on the miscompilation that was fixed: https://www.reddit.com/r/rust/comments/1wzn34d/1990_miscompilation_with_ffi_bool_return_type_on/
r/rust • u/matthieum • 26d ago
Code Dumps, ie links to code repositories, are no longer welcome on r/rust.
If you are excited about a project you built, and just wish to share it, consider posting a casual top-level comment in the weekly What's Everyone Working on this Week? thread.
When r/rust was created, in December 2010, Rust was a nascent programming language. It was very different, it was also fast-moving, and it was unclear whether it would amount to much, or not.
In these early days, new projects being written in Rust were both a proof that the language was suitable for a variety of purposes, and a cause for celebration in seeing the language being adopted. Code dumps, then, were both cause to rejoice, and an opportunity to see how well (or not) the language was suited to the task. They were even a good opportunity to learn the latest developing idioms of this fast-changing language.
Fast forward 15 years, and code dumps have become boring. Utterly uninteresting. There's nothing exciting, or newsworthy, about a 10th hypervisor project, a 100th webserver project, or a 1000th TUI project. And for the most there's no exciting idiom, or pattern, to be found in their code either... even if some poor soul bothered to look.
And mass AI generation appeared on the scene, and for the past year(s), the already dwindling appeal of code dumps has just completely vanished, buried in AI slop.
r/rust is to discuss all things Rust. The language, the ecosystem, the community.
Of late, most code dumps barely foster any discussion. And when they do, apart from AI witch hunts, those discussions are mostly about the domain of the project, rather than about Rust. Depending on the domain, the discussion may or may not be of interest to r/rust users... but whether it is or not is a matter of chance: they did not come here seeking such a topic. Those discussions are tolerated on posts which are on-topic, but if a post only fosters "tolerated" discussions, then that is a sign that the post itself may simply not really be on-topic for r/rust.
And that is not to say that code dumps are, by nature, low-effort. Surely, a project is created for a purpose, to solve a specific problem that is unsolved, or solve it with different trade-offs than the currently available solutions. None of that is elucidated in a code dump.
Code dumps are no longer welcome on r/rust.
Code dumps of applications or libraries written in Rust are Low-Effort unless otherwise newsworthy. Newsworthy means that the very existence of the application or library is important, for example consider applications or libraries breaking new ground, such as the first hypervisor, first OS, first XXX standard safety-critical application, first Rust application in a major company, etc...
Announcements of new libraries which are not otherwise newsworthy are only welcome if they tick ALL the following boxes:
(It goes without saying, but the announcement should NOT be AI-generated, not even in part, as AI-generated posts & articles violate the Low-Effort rule)
Release notes of libraries are still welcome for popular enough libraries, such as libraries with reverse-dependencies on crates.io pointing to sufficient adoption by the wider community to justify notifying said community of a new release.
Developer Tools follow the same rules as libraries, with one extra rule tacked on: they must be relevant to Rust developers in particular. For example, Release Notes of Meson (a build tool) are Off-Topic, unless this specific release improves Rust support.
Of course, text posts, or links to articles, centered on Rust, with an application, library, or developer tool as context are always welcome. For example, said posts or articles could present gnarly problems the author encountered, and how they solved, or which features of the language or a library helped or hindered them in the making of their project.
(It goes without saying, but said text posts & articles should NOT be AI-generated, not even in part, as AI-generated posts & articles violate the Low-Effort rule)
As a reminder, if an author just wishes to share their joy of building something in Rust, they are welcome to use the What's Everyone Working on This Week? thread. And as per the title, it need not even be a complete/mature project, or an open-source project for that matter as links to code are strictly optional there, it's all about casually chatting about your work on Rust projects.
See pinned comment below.
Edit 2026/10/04:
Mystified about strings? Borrow checker has you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.
If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so ahaving your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.
Here are some other venues where help may be found:
/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.
The official Rust user forums: https://users.rust-lang.org/.
The unofficial Rust community Discord: https://bit.ly/rust-community
Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.
Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.
r/rust • u/noop_noob • 5h ago
Previous discussion on the miscompilation that was fixed: https://www.reddit.com/r/rust/comments/1wzn34d/1990_miscompilation_with_ffi_bool_return_type_on/
r/rust • u/noop_noob • 13h ago
The rust compiler thinks that `data/baselines/table.rs` and `database/line/stable.rs` are the same file, causing a miscompilation if a crate has both files in it. (Note that having the same non-slash text isn't enough. There needs to be an additional hash collsion for a bug to happen.)
Probably not gonna happen in practice unless someone does it as a prank, but still... lol. (I'm sure they're gonna fix it soon.)
r/rust • u/PatagonianCowboy • 1d ago
r/rust • u/ruprechttmb • 11m ago
was cleaning up my mac and found one projects target folder sitting at 13 gb. debug and release builds, incremental cache, deps for every feature combo i ever tried- all for one project.
things that actually helped. `cargo clean` in projects youre not touching right now is the obvious one, it all rebuilds when you come back. cargo sweep is nice if you want to keep recent stuff and drop artifacts older than a few days, `cargo sweep --time 14` for example. and if you have a lot of small projects, pointing `CARGO_TARGET_DIR` at one shared folder stops every repo from compiling its own copy of the same deps, though parallel builds can block each other on it
to see whats there, `find ~/code -name target -type d -prune -exec du -sh {} +` works, just swap in wherever you keep projects. heads up it also catches maven target folders if you have java stuff
curious what other people do, especially anyone with a big workspace
Hello r/rust,
I prefer to avoid macros when they can be avoided without major sacrifices, and I ran into this again recently with bitflags.
I wanted several simple bit flags, but every bitflags! macro invocation expanded to about 800 lines of code.
So I wrote bitflags-lite: https://crates.io/crates/bitflags-lite, https://docs.rs/bitflags-lite
The design is simple: instead of generating a distinct struct per flag set, it defines a single generic BitFlags<T, U> where:
* T is storage type like u8 or u32,
* U is a tag that describes which bits are valid, their names, and the default parsing strategy for case sensitivity.
```rust use bitflags_lite::{BitFlags, BitFlagsSpec, NameMatcher};
struct PermissionsTag;
impl BitFlagsSpec<u32> for PermissionsTag { const VALID_BITS_MASK: u32 = (1 << 3) - 1; const FLAG_NAMES: &[&[&str]] = &[&["read"], &["write"], &["exec", "execute"]]; const DEFAULT_NAME_MATCHER: NameMatcher = NameMatcher::AsciiCaseInsensitive; }
type Permissions = BitFlags<u32, PermissionsTag>;
const READ: Permissions = Permissions::try_from_bit(0).unwrap(); const WRITE: Permissions = Permissions::try_from_bit(1).unwrap(); const EXEC: Permissions = Permissions::try_from_bit(2).unwrap(); const RWX: Permissions = Permissions::try_from_bits(0b111).unwrap();
assert_eq!(RWX, (READ | WRITE | EXEC)); assert!(RWX.contains(READ));
let flags = Permissions::from_str("ReaD | 0x18 | wriTE").unwrap(); assert_eq!(flags, (READ | WRITE | Permissions::from_bits_retain(0x18))); assert_eq!(flags.to_string(), "read | write | 0x18"); ```
That's the whole definition. No hidden codegen.
What you give up:
* No automatic deduction of names and valid bits.
You write VALID_BITS_MASK and FLAG_NAMES by hand and keep them in sync with your constants.
* No named multi-bit flags.
You can still build a set containing several bits (Permissions::try_from_bits(0b111) above),
but there's no way to declare a multi-bit constant inside the spec.
Each bit corresponds to exactly one BitFlag with a name and optional aliases.
What you get instead:
* The generic BitFlags<T, U> type.
* A clearer single-flag (BitFlag) vs. flag-set (BitFlags) distinction.
* A single small trait impl per flag set, rather than a fresh copy of the entire API.
* Alias names for parsing ("exec" and "execute" for the same bit).
* Optional ASCII case-insensitive parsing.
The crate supports no_std and no_alloc, and is const-friendly.
Every constructor and combinator on the concrete integer types is const fn, with generic equivalents in BitFlagsExt / BitFlagExt.
Optional serde, arbitrary, and bytemuck support via features.
I would love to hear your feedback, and I am happy to answer questions!
r/rust • u/Ozyme-69 • 19h ago
Intoduction and Background:
Hi, I am a B.Sc CS graduate (below tier 3 as it seems) 2026 from India. Graduated in august 2026. Been looking for job for past 2 months.
I have been using Rust for 3 years now. I have used it for my ambitious projects like compilers, emulators etc. And now I am trying to build semi professional grade projects (backend and systems) in Rust.
Problem:
There are not much jobs in Rust for freshers. Even if there are, they are very niche and require some additional domain knowledge or certification.
Suggestion Needed:
Ever since I learned Rust, I automatically get drawn to my RustRover IDE, I hit 'cargo init' and just start with a project. This has become harmful now. I am trying to migrate to other languages (Python, Go, Java) which has actual market for freshers, but I am failing everytime as soon as I miss the the features rust provided - top level module and visibility support, ADT enums, Result and Options, borrow checker, etc.
If anyone have gone through this same phase, please help me, how can I overcome this. How can I pick a second language and start making projects there, to increase my Resume value.
Thank you if you have adviced me below, sorry if anyone feels I am yapping, but I am genuinely concerned and need real help (Not AI motivation).
r/rust • u/noop_noob • 1d ago
Next-solver has just started the 10-day FCP period. It is planned to be stabilized in version 1.101.0, which is scheduled to release on 24 December.
For more context: https://blog.rust-lang.org/2026/08/21/enabling-next-solver-on-nightly/
Previous discussion: https://www.reddit.com/r/rust/comments/1vuita3/enabling_the_nextgeneration_trait_solver_on/
r/rust • u/noop_noob • 1d ago
A person working towards stabilizing the Try trait is asking for real-world examples of use cases of the currently-unstable Try trait.
r/rust • u/THEM_I_M • 5h ago
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MailboxEnvelope {
pub recipient_id: String,
pub ephemeral_pub: String,
pub ciphertext: Vec<u8>,
pub nonce: String,
pub created_at: u64,
pub message_id: String,
pub attempts: u32, // delib. excluded from AAD so retries don't invalidate ciphertext
}
impl Drop for MailboxEnvelope {
fn drop(&mut self) {
self.ciphertext.zeroize();
}
}
Iβm working on a small Rust mesh-protocol project (GhostWire: libp2p, ChaCha20-Poly1305, Kademlia offline mailbox delivery). In this sealed type, I bind AAD to immutable fields and exclude attempts so retry writes donβt reseal offline ciphertext.
The thing Iβm unsure about is zeroization discipline:
Is manual Drop zeroization enough once Clone creates another allocation?
For Serialize/Deserialize temporary buffers, should I treat the Vec<u8> canonical copy as the only zeroized target?
Would secrecy::SecretBox / zeroize-wrapped types be worth it here, or overkill for an encrypted envelope?
For a retry state mutation in AAD, is excluding attempts the correct tradeoff?
Iβm looking for actual production patterns, not just theory.
r/rust • u/nightcracker • 1d ago
r/rust • u/trailbaseio • 1d ago
TrailBase is an open and fast(est) Firebase-like backend (BaaS) for building your apps. It provides: type-safe APIs with change subscriptions, auth, multi-DB, a WebAssembly runtime, GeoJSON, admin UI, ...
It's a single self-contained executable, easy to self-host and built with Rust, Wasmtime & SQLite and more recently also Postgres. We provide clients for many environments: JS/TS, Dart/Flutter, Go, Rust, .Net, Kotlin, Swift and Python.
Just release v0.34.6. Since the last time posting here, TrailBase has added:
The project is still young (~2 years) and rapidly evolving, any feedback is genuinely appreciated. If you're feeling adventures and end up checking it out, don't hesitate to reach out π.
r/rust • u/ioncodes • 1d ago
TLDR: Gecko is my GameCube and Wii emulator written in Rust. This update adds texture packs, easier setup and more fixes for graphics, audio and performance. Mario also gets his eyes back :)
This release is especially interesting for the ones that were bothered by the system files (DSP, IPL) requirements! No more!! :)
It's been a while since my last update, where I shared about recent performance improvements, savestates and freecam support. I've since been working through more improvements and making Gecko easier to get started with!
For anyone new to the project: Gecko also includes a debugger, a GPU FIFO recorder/player (and a dedicate debugger for it) and various other tools for exploring how these games work!
Some highlights from this update:
Something unique for this update: I recently started writing blog posts about the bugs behind these fixes, aimed at future emulation developers incl. lots of interactive visual explanations. If you enjoy the technical side of emulation, these might be interesting:
As usual, the useful links:
As always, thanks a lot to everyone that provided valuable feedback, tested things on their hardware, encouraged me with this project and let me pick their brains! We'll see each other next time!
PS: I spoilered the release of Sly, my take on modern multi system emulation (also written in Rust, incl. the GUI!) in the last post. It's going public in the next days, so stay tuned for that :) It will also release with a 3 part blog series explaining how GBA graphics work!!
r/rust • u/thorsten-hans • 1d ago
My new book is now available on Leanpub
https://leanpub.com/building-serverless-apps-with-wasm-and-spin
r/rust • u/Fabulous_Savings_179 • 9h ago
I've been building docmux, a document converter (LaTeX, Markdown, Typst, DOCX, HTML, MyST) with a Reader β AST β Writer pipeline. Each format is its own crate, so the WASM build only carries what it uses. Playground: https://docmux.pages.dev/playground/ (runs entirely in the browser).
A few things I learned along the way:
Code (MIT): https://github.com/aguschirico/docmux
The crates are on crates.io (cargo install docmux-cli). Feedback on the crate layout or the AST is very welcome.
r/rust • u/PlusDistribution1915 • 11h ago
Long story short: a year ago at my company, we ran into a nasty Head of Line blocking problem with Kafka. To solve it, I built a hack that used Postgres to offload long-running jobs.
It worked well enough that I decided to implement it properly, initially building a C++ broker that talked to Postgres.
Then, 4 months ago, I rewrote the whole thing in Rust.
Why? Even though I love C++ and know it better than Rust (I like having the freedom to shoot myself in the foot), I found it much easier to reach high performance with Rust in the era of AI. In C++, wiring together multiple asynchronous systems (like the uWebSockets event loop with the libuv event loop for Postgres) is tedious. Rust's ecosystem made this significantly smoother.
Then, less than a month ago, we dropped Postgres entirely. We moved straight to direct disk writes and Raft replication using Openraft and heed (LMDB).
Why? Primarily to drop the requirement for HA Postgres. Plus, no matter how efficiently you write to Postgres, you can't store an infinite amount of data without eventually degrading performance.
So, I want to present QueenMQ to the Rust community. It now powers almost every product in our company.
What makes it different: every entity (a customer, an order, a chat session) gets its own ordered partition, created by the first push that names it. There's no partition count to plan, and one slow customer never blocks the others, which was exactly our Kafka problem. Also, no more rebalancing. And each processing step is one transaction: ack the input, push the next events, write state and set a timer, all or nothing, with no outbox table or separate scheduler. Partitions in QueenMQ are logical, not physical.
Features:

It's named QueenMQ (because 10 years ago I misread the word "queue"), and it is open-source under Apache 2.0. I'm sharing it because I firmly believe it has evolved into an amazing piece of infrastructure.
Think of it as a mix of Kafka (partitions with commits) and RabbitMQ (Ack/Nack). Simplicity is a core focus for us. Because of this, we chose to use HTTP and a single Raft group per tenant. While that naturally puts a ceiling on maximum throughput, it allows for seamless cross-partition/queue transactions without the complexity of two phase commit.
I call it "transactional message broker".
I know some folks here are strongly against using LLMs for writing code. As a software engineer with 15 years of experience, I take a different view: I love it. I use AI extensively to execute the implementation, but I own every single architectural, systems, and safety decision.
And trust me, it was not easy: I dedicated a year of my life to it and broke production twice along the way (which took another year off my life). The roadmap we have is still long (improve byte efficiency right now, the next release will have 1/3 of the current e2e p99 latency, and tons of other things) but I would love to hear what the community thinks, or answer any questions about our migration from C++ and Postgres to Rust and Raft!
Link to the repo: https://github.com/queen-mq/queen
r/rust • u/Most-Wanted-Man • 10h ago
Throughout my career I only build websites especially backend stuffs. I want to try Rust. Possible?
r/rust • u/Fine-Reflection-7530 • 11h ago
r/rust • u/noop_noob • 2d ago
r/rust • u/nova_protocol • 7h ago
I'll die on this hill: Result<T, E> beats exceptions. No hidden control flow, errors are values, compiler forces you to handle them. I've written enough Go and Python to never want
implicit throws again. But there's one thing I never see anyone talk about honestly the ? operator at depth.
2-3 levels deep? Beautiful:
fn parse_config(path: &str) -> Result<Config, AppError> {
let content = fs::read_to_string(path)?;
let config = serde_json::from_str(&content)?;
Ok(config)
}
Clean. Explicit. Love it. Now you're 7 functions deep in a real system. You get this:
Error: invalid type: null, expected u64
That's it. No line. No context. Somewhere in your 200 lines of ? chains, something broke. Good luck. With an exception runtime? Stack trace. Immediate.
Yes I know anyhow. I know .context("while doing X"). But now you're manually reconstructing what exception runtimes give for free. And the moment you forget one .context() three
layers down which you will you're back to guessing. thiserror is great at library boundaries. Inside an application you end up with either 40 custom error variants each wrapping
the previous, or anyhow everywhere which is basically dynamic exceptions with extra steps.
Rust made the right tradeoff. The cost is just more real than people admit. How do you actually handle deep error chains in production? What pattern did you settle on?
r/rust • u/Accomplished-Use405 • 1d ago
Is there a function in std, which would allow to get a list of (field_name, type) of a struct in order it is compiled in? Since order of fields is not deterministic.
Something like: `fn fields_of_val<T>(&T) -> Vec<(&'static str, &'static str)>`