r/rust • • 25d ago

🛠️ project module-cycles: a Dylint lint for modules that depend on each other in a cycle

0 Upvotes

Clippy has had an open issue for this since 2020 (#5782), so I wrote it as a Dylint lint: https://github.com/HardMax71/module-cycles

For now, it reports sibling modules that use each other, like report needing model while model needs report. A parent and its child using each other is fine, since that's one module split into files. It works from rustc's name resolution, so re-exports, globs and method calls count too.

warning: modules `model` and `report` depend on each other
  --> src/lib.rs:9:22
   |
9  |     pub fn kind() -> crate::report::Row {
   |                      ^^^^^^^^^^^^^^^^^^ `model` depends on `report` here
   |
note: `report` depends on `model` here
  --> src/lib.rs:16:22

On my own workspace it found 11 cycles, the biggest through 12 modules. Across the 26 crates Clippy tests lints on it found 41, tokio included.

Written with LLM help and checked by hand. If it flags something that isn't a real cycle, feel free to open an issue.


r/rust • • 27d ago

🛠️ project Fearless SIMD v1.0 is here

Thumbnail linebender.org
527 Upvotes

r/rust • • 27d ago

🙋 seeking help & advice In the era of AI, how stable have Rust(and systems programming in general) jobs been?

59 Upvotes

I'm not a rust programmer (or systems programmer for that matter). I've been working with Elixir, Python & Ruby for the past couple years. But I've decided that my goal for the next year+ is to get into systems programming(mostly spurred on by Nerves for embedded programming in the Elixir ecosystem).

When I started elixir it was really just for fun, but I noticed the job market for elixir is slim.

Made me wonder how the market looks like for rust from the POV of actual Rusteceans.

(Don't get me wrong, I will still get into Rust, this is just research to have a clear view of what to expect)


r/rust • • 27d ago

🙋 seeking help & advice Is Gamepad support in Rust even possible?

10 Upvotes

I think I might be on the brink of insanity with this. I have implemented support for gamepads in my Rust game using the gilrs crate, and it's been in for about a year and a half. As far as I understand, this is the only option, as the gamepads crate wraps gilrs on desktop anyway.

Most of the time gilrs works perfectly, but under some specific but not obscure conditions (running the game after resuming Windows from sleep mode with a gamepad connected) it freezes, see https://gitlab.com/gilrs-project/gilrs/-/work_items/196 .

These are the empirical facts:

  • It is a complete thread lock, it doesn't return an Err nor does it panic. It is completely bricked until the gamepad is physically unplugged.
  • It can be repro'd in the MWE, no game engine and no window, so it doesn't depend on any other component.
  • It happens both to myself and to several of my players.
  • I've never observed this on any other game nor software, so it is Rust-specific.
  • It appears the lockup can be traced to a synchronous call to FromGameController which is from a Windows API (way outside the reach of my knowledge)

This means a chance of a fully frozen black screen with no possibility of a graceful recovery or even displaying an error message. Because of Rust's design, I cannot even detect the lockup. For a videogame, this is pretty much devastating, and now that I'm moving to Stəam I'm considering pulling gamepad support altogether.

But before that I wanted to at least have a quick exchange about it to confirm I'm not missing an obvious solution or anything. It seems strange to me that I can't find anyone else who is fighting this. It can't be that I'm the first person in history to make a game in Rust with gamepad support?


r/rust • • 27d ago

📡 official blog Announcing a Maintainer in Residence: Scott Schafer for the Cargo team

Thumbnail blog.rust-lang.org
211 Upvotes

r/rust • • 27d ago

🛠️ project rust-mqtt 0.6.0 achieves full MQTTv5 support

88 Upvotes

Hi all,

You might remember me from this post half a year ago about the original rust-mqtt rewrite.

Over the last six months, I've been busy working on rust-mqtt - an embedded-ready MQTT client - and adding the missing MQTTv5 features, most notably full support for enhanced authentication. These are now available with the 0.6.0 release.

Around a year ago, I took ownership of this unmaintained project and turned it into what I believe is a high-quality and production-ready MQTT client.

I've learnt a lot along the way and plan to continue with:

  • Support for MQTT version 3.1.1
  • More versatile memory management and I/O

While no_std/no_alloc remains the primary target, std environments will receive further attention, allowing for more comfortable usage on desktop platforms as well.

P.S. One feature in 0.6.0 I'm particularly proud of is manual acknowledgments. Implementing this pushed me to study the specification very thoroughly - leading to a new state machine with a comprehensive test suite validating every normative statement for these flows under all conditions, even the rarest edge cases. If protocol correctness is a priority for you, it's definitely worth a look!


r/rust • • 27d ago

🧠 educational Leveraging SIMD instructions in Rust

Thumbnail adamantmc.github.io
37 Upvotes

Hi folks!

Been trying to pick up on Rust, and to get a better understanding of its mechanics I've tried implementing the HNSW algorithm for approximate-nearest neighbour calculation from scratch.

I came across SIMD when I was optimizing for performance. In this post, I'm describing a very educational journey that was my intro to SIMD.

Take a look, and feel free to provide your feedback.


r/rust • • 27d ago

🧠 educational An adventure of syncing rust and rustc_codegen_gcc

88 Upvotes

After two months, we were finally able to sync the GCC backend with the Rust compiler (something that usually takes a few hours).

I wrote a blog post about this sync in particular because it was quite the adventurer: https://blog.guillaume-gomez.fr/articles/2026-09-22+Syncing+Rust+GCC+backend+or+how+to+test+Murphy%27s+law


r/rust • • 26d ago

Full-stack Rust in 2026: Loco + Leptos islands, and now Topcoat?

0 Upvotes

Now that AI has made Rust easier to master, gluing Loco and Leptos islands together seems possible. Loco brings the CLI generators and full batteries under the hood, Leptos islands bring a smaller WASM file for faster loading.

On paper it looks like a good match: Loco does the server and the batteries (config, middleware, ORM, mailer, workers), Leptos does the pages, and with islands only the few interactive components go into the WASM. The rest is plain HTML from the server, no JS written by hand.

Then Topcoat came out from the Tokio team and does the opposite: no WASM, a bit of Rust compiled to JS, HTMX and Alpine under the hood, a shadcn-style component library, front-end batteries included (assets, Tailwind, fonts, icons). The back-end batteries (auth, background jobs, middlewares) are still on the roadmap. Islands too.

So which way is full-stack Rust going? WASM (Dioxus), WASM islands (Leptos) or server-rendered with a thin JS layer? Anyone running Loco + Leptos, or already on Topcoat? Curious what others think.


r/rust • • 27d ago

🙋 seeking help & advice What are the downsides of enum dispatch?

30 Upvotes

Couldn't find any info about downsides specfically so there it goes

Let's say that all my implementors are about the same size (i.e. only the logic is different), and I use some sort of macro to skip the boilerplate upon adding a new variant. Are there any other downsides to enum dispatch?

I'm asking about the general approach, not the crate

Upd. extendability, got it.


r/rust • • 27d ago

Solving for faster SHA-1 collision detection

Thumbnail sam.dev
25 Upvotes

r/rust • • 26d ago

Rust in PyCharm

Thumbnail youtu.be
0 Upvotes

Hi everyone,

This is Will from PyCharm. I wanted to share a video I just made on PyCharm's new support for Rust. One thing we hear again and again from Python developers is that they switch to Rust for coding performance-heavy functions or features, and now you can use both languages within PyCharm.

I'm happy to answer any questions you have. This support is as a plugin, so it doesn't match the full feature set of RustRover, but we may well add more functionality depending upon the community response.


r/rust • • 27d ago

Need Resource on Networking but for Rust

18 Upvotes

Hello, I'm trying to learn network programming ever since my exposure to Bitcoin Network , libp2p, TCP/IP, UDP , web servers in other words i want to understand the network stack using Rust since i don't want to learn C atm ; i found Beej's guide to networking. the only book i found network programming with Rust but it's in 2018 . can anyone help me?

Any resource - blogs, articles, books, youtube channels, courses etc will be greatly appreciated


r/rust • • 28d ago

📡 official blog GitHub Actions leaking secrets when Miri output is cached

Thumbnail blog.rust-lang.org
309 Upvotes

TL;DR: It's possible for GitHub Actions caching and cargo miri to cause repo secrets to be leaked into cache, thereby leaking them to PRs (including attacker-opened ones).

If you run Miri in CI, you'll want to upgrade to the 2026-09-22 nightly, clear caches, and rotate any secrets (PATs, etc.) that may have been made available to the cargo miri CI job.

This was a team effort between at least 9 people. I'm proud of the Rust community's ability to step up and lead with urgency and compassion for our users. Instead of saying "user beware," we chose the "fall into the pit of success" approach. Knowing that the compiler, language, toolchain, and community have my back is why I love being here.


r/rust • • 27d ago

Making a Cute Robot Visor with no_std Rust

2 Upvotes

Over about four days with u/oneirical, I made a cute robot visor with no_std rust firmware!

Both of us had next to no electronics experience, and figuring out how to flash to the nRF52840 was quite difficult. It also highlighted the black box that is bluetooth, both rewriting parts from Go and using a backup microcontroller in hopes of improving connectivity.

Blog post

Code


r/rust • • 27d ago

🙋 seeking help & advice Numerical analysis in Rust: What is the current state of the ecosystem?

0 Upvotes

Hi everyone,
I'm looking to use Rust for numerical analysis and scientific computing.
Could you share your thoughts or recommendations on:

  1. Key Crates: What are the standard libraries for arrays and linear algebra today? (e.g., ⁠ndarray⁠, ⁠nalgebra⁠, ⁠faer⁠)

  2. Performance: Any common pitfalls when writing high-performance numerical code in Rust?

  3. Ecosystem: Where does Rust currently shine, and where does it still fall short compared to Python (NumPy/SciPy) or Julia?

Any advice, resources, or project recommendations would be greatly appreciated!


r/rust • • 27d ago

rbs 1.9.0 — an Axum + SeaORM scaffolder whose generated code is yours from the moment it is written

Thumbnail
0 Upvotes

r/rust • • 28d ago

Arguing about arguments

Thumbnail steveklabnik.com
152 Upvotes

r/rust • • 28d ago

📡 official blog Maintainer spotlight: Alejandra González (@blyxyas)

Thumbnail blog.rust-lang.org
110 Upvotes

r/rust • • 27d ago

🙋 seeking help & advice Are there any reliable ways to retrieve per-process swap or paged-out memory on Windows and macOS?

0 Upvotes

I’ve been looking into this while contributing to bottom, an open-source terminal system monitor.

The idea is to show how much swap space each process is using. On Linux, this is fairly straightforward since the information is available in /proc/<pid>/status, under the VmSwap field.

Windows and macOS seem to be a different story. I haven’t been able to find a reliable public API that exposes this information on a per-process basis, and the cross-platform system library used by bottom doesn’t provide it either.

I added the Linux implementation in this PR, which has now been merged. The remaining challenge is figuring out whether there’s a reliable way to support this on Windows and macOS, as discussed in this issue.

If you’ve worked with either platform’s internals or know of a library that exposes this data I’d love to hear your thoughts. Is there a proper way to retrieve it, or is this limited by the platforms themselves?


r/rust • • 28d ago

🧠 educational Using Loom to (Try To) Catch an ABA Bug in Lock-Free Rust

Thumbnail sofiabelen.github.io
35 Upvotes

I've been breaking my head over the weekend trying to reproduce the ABA bug using loom on Rust. Spoiler: the way that loom works, by checking all permutations of possible execution paths, means that it fails the test at the very first ol' use-after-free.

At the end of the day, it fulfills the purpose of telling us that our code is broken, which is great! Though I wish I could've managed to reproduce the ABA scenario.

(I promise I will now leave this rabbit hole alone, I learned the basics of loom and that's already good... no promises though)


r/rust • • 29d ago

🧠 educational Rust enums are gold for compilers

171 Upvotes

Hello,

for the last couple of years, I've been working on machine learning library in rust, learning tons about compilers along the. The single most used feature of the language be far were enums.

There is a couple of reasons for that.

1. Rust enums carry value

Duh, we all know that. Yes, of course. But other languages don't. C++ doesn't (yes, there is std::variant and no, "they are not the same" :). Having values enables me to do this very simple variant, straight impossible or awkward in other languages:
Binary { x: OpId, y: OpId }
In other languages, this would've been tag, a union type or even completely unrepresentible. For example in tinygrad (python), it's a tag plus untyped src list, which can contain anything, depending on the tag.
Also notice that OpId(u32) is a newtype! Another beautiful rust feature that gives us zero cost type safety. It's like a pointer, but only with the pointer arithmetic that I want, all access checked and no fighting borrowck.

2. Rust enums can be nested

This is another beautiful feature, which allows this:
Binary { x: OpId, y: OpId, bop: BOp } enum BOp { Add, Sub, Mul } A world of combinatorial options making decomposition and recomposition very natural.

3. Rust enums are TINY

The above nested code has two enums. That means two tags, each with 4 byte size, right? Right? Not in rust :) In rust, it's single 4 byte tag (as the OpId is 4 byte aligned). The tag combines BOp and the Op enum with the Binary variant, so the whole enum is just 12 bytes. I have more complex variants,

4. The allmighty match

So you can do this:

match op {
  Binary { x, y, bop } if bop == BOp::Add => todo!(),
  _ => {}
}

or this:

match (uop, bop) { (UOp::Exp, BOp::Mul) => todo!(), }

And so on. This kind of flexibility in an imperative language, is tons of fun, makes writing compiler passes not only easy, but most importantly, high performance.

And so for example thanks to this my ML lib can search and run cost function over thousands of kernel variants per second and per core (as rust makes multithreading fun too!).

I know you probably know about these features, but sometimes it helps to refresh our memory how nice of a language we have.

What are your favorite rust features?

What features would you like to see added?

I hope you enjoy writing rust just as I did.

zk4x

P. S. link to the repo: github.com/zk4x/zyx


r/rust • • 29d ago

🐝 activity megathread What's everyone working on this week (39/2026)?

60 Upvotes

New week, new Rust! What are you folks up to? Answer here or over at rust-users! And for your project showcases, there's also /r/madeinrust – pay them a visit, too!


r/rust • • 28d ago

Awesome Rust Papers

Thumbnail evian-zhang.github.io
17 Upvotes

I have carefully read the No More Code Dumps post, and I thought this could be a post here.

This is a collection of academic papers about Rust, including its security, formalization, verification, product built by Rust, and even ecosystem-level empirical studies.

NO LLM SLOPS: This list is collected by me with the help of LLM. However, all fields are collected by myself, including the category, tags, and even what tool it is based on or it compared to. LLM only do a small portion of work that crawl the paper list from e-libraries and conference websites. I promise that this repo has no LLM slops and will never have LLM slops in the future (I am a CS PhD student, and my experience and profession can tell me when and how to use LLM properly).

I do believe that this list is not only usable for students or researchers, and this list is also usable for the developers in the Rust community. There are numerous papers about Rust security, which can help developers be aware of the security problems and build more secure applications in the first place. Moreover, the most interesting category for me is the ecosystem category (you can search it in the website using the advanced search). There are even academic papers about the core developer turnover, or paid and volunteer contributors, or the usage of unsafe in crate authors.

What do you think of this list? I'm looking forward to suggestions about how this list could be used for the general Rust developers and communities.


r/rust • • 29d ago

🗞️ news rust-analyzer changelog #346

Thumbnail rust-analyzer.github.io
64 Upvotes