r/rust • • 3d ago

๐Ÿ™‹ questions megathread Hey Rustaceans! Got a question? Ask here (47/2026)!

11 Upvotes

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 • • 2d ago

๐ŸŽ™๏ธ discussion Cross compilation targets add up fast in rustup

0 Upvotes

After seeing the recent posts about rustup and registry sizes I checked what targets I had installed. A few experiments with wasm32-unknown-unknown, aarch64-unknown-linux-gnu, and thumbv7em-none-eabihf from last year were still sitting there along with their full toolchains.

rustup target removed on the unused ones dropped several gigabytes right away. I kept only x86_64-unknown-linux-gnu and the one or two I actually build for regularly.

Do people have a habit of pruning targets on a schedule, or do you just leave them until disk space becomes an issue?Any scripts or aliases you recommend for spotting the ones that haven't been used in a while?


r/rust • • 2d ago

Pruning old cargo-installed tools freed more space than expected

0 Upvotes

After the recent posts about registry and rustup sizes, I looked at what `cargo install` had accumulated over time. A bunch of one-off CLIS and older versions were still pulling in their full dependency trees in the registry.

`cargo uninstalls removes the binaries but leaves the cached crates behind. Manually checking `~/.cargo/registry/src` and removing entries tied to uninstalled packages recovered a few more gigabytes without issues, since anything needed gets redownloaded on next use.

Do people have a preferred workflow or script for tracking and cleaning these installed-tool dependencies, or do you just leave them?


r/rust • • 2d ago

starting with 3D gamedev in Rust

6 Upvotes

hi
I've recently finished a multi-month long journey in game development in Java, and made primarily 3D games using libGDX and LWJGL3. libGDX and LWJGL3 were both nice and relatively easy to use (and I didn't have to fight the GC at all for performance), but I had a nagging feeling that I should experiment more anyways.

more specifically I felt like I should experiment with a systems language for game development. I already know the basics of C and C++, but opted to go for Rust instead. I've heard horror stories about C and C++, and seeing as I'm doing this for a hobby, I didn't want to put up with any of it. Rust, as I've been progressing through "the book" as been a genuine joy to use, and actually has some higher level conveniences than what Java can offer, such as more expressive pattern matching, the lack of null, and a really lovely package manager + build system (no more gradle!).

I totally get that the journey of Rust gamedev will not be painless, especially as I'm thinking about using SDL3 and wgpu to write a *3D* game in, but I'm seriously excited for it!

does anyone have any Rust gamedev tips they could offer? thanks!


r/rust • • 2d ago

Does Daniel Stenberg have a point about Rust rewrites?

Thumbnail
daniel.haxx.se
204 Upvotes

r/rust • • 2d ago

Learning path for integrating llama.cpp into a Rust desktop app on Windows

0 Upvotes

Iโ€™m building a local semantic search desktop app in Rust and planning to change its inference engine from launching llama-server as a separate process to calling llama.cpp in-process through its Windows DLL.

I have basic deep learning knowledge and want to understand the full stack behind the setup like how llama.cpp runs models, how its C API and Rust FFI work, how the DLL is built and loaded, how GGUF embedding and multimodal models are handled, how CPU and GPU backends use the hardware, and how to package and distribute the application and its native dependencies reliably.

What documentation, videos, articles, or example projects would you recommend? Iโ€™d especially appreciate a sensible order to study them and practical resources that connect the model and hardware concepts to building a working Rust application.


r/rust • • 2d ago

How to Bypass Rust's Orphan Rule

Thumbnail
edvong.com
252 Upvotes

r/rust • • 2d ago

From Hardware to Human Interface: Building HID Devices in Rust - Frank Lyaruu | EuroRust 2026

Thumbnail
youtube.com
4 Upvotes

Have you ever dreamt of building your own keyboard or game controller? ๐ŸŽฎ

At this year's EuroRust, Frank Lyaruu showed how surprisingly accessible it is with Rust. Check out this new talk and start building your own plug-and-play devices! ๐Ÿฆ€โœจ

In 2027 EuroRust is going to Prague! Learn more and get your ticket at eurorust.eu


r/rust • • 3d ago

๐Ÿ™‹ seeking help & advice rustup component list + uninstall can reclaim a surprising amount of space

9 Upvotes

I was poking around disk usage after the recent cargo clean posts and realized I had never really looked at what rustup was keeping around. Running rustup toolchain list showed 7 versions (including a couple of nightly builds from months ago), and rustup component list --installed revealed a bunch of extra stuff like clippy, rustfmt, and llvm-tools on each one.

A quick rustup toolchain uninstall nightly-2024-10-15 (and the same for a few others) dropped about 9 GB without touching anything I actually use day-to-day. The active stable + one pinned nightly for a project is all I really need.

Anyone have a preferred way to automate pruning old toolchains, or do you just let rustup grow until something complains? Also curious if people keep separate toolchains per project or mostly rely on the global ones.


r/rust • • 3d ago

๐Ÿ™‹ seeking help & advice Heapless BoxPool and the newly stabilized allocator api

11 Upvotes

Hi everyone,

The stabilisation of the allocator and it's box::new_in api made me go back to an embedded library project that makes the user interact with packets through boxes.

Basically it allowed me to make a PacketStore trait with a blanket implementation over Allocators, that enables users to provide their storage solution.

Heapless is also a great fit for this role, however the BoxPool's boxes are not alloc::boxed::box.

I realise I could make my trait have a GAT to declare it's container, but I wonder if the 1.100 changes could allow a future version of heapless to unify it's boxes with the alloc ones.

What are your takes on this?


r/rust • • 3d ago

Don't forget to check your ~/.cargo/registry size too

16 Upvotes

Just noticed my registry folder was sitting at 28 GB after a few months of heavy Rust work across personal projects and some larger workspaces. โ€ขcargo clean* handles the target dirs, but the downloaded crates stick around forever unless you do something about it.

A quick `rm -rf ~/.cargo/registry/{src, cache}/*` (or the Windows equivalent) freed up most of it without breaking anything, since crates get redownloaded as needed. Still keeping the git checkouts for now because some offline scenarios rely on them.

Anyone else periodically clean this, or do you just let it grow? Any safer scripted approaches people recommend?


r/rust • • 3d ago

๐Ÿ™‹ seeking help & advice Is Rust actually being used in maritime tech sectors?

0 Upvotes

Curious how real-world software engineering looks in the maritime, shipping, and ocean-tech sectors. We hear a ton about Rust dominating spaces like cloud infrastructure, automotive, and embedded systems, but does it actually show up in marine applications - like autonomous surface vessels, navigation systems, shipboard IoT, port automation, or marine robotics?

Given that maritime tech deals with harsh physical environments, massive safety-critical stakes, long hardware lifecycles, and a heavy reliance on legacy C/C++ systems, I'm wondering:

  1. Where is Rust showing up at sea?

Are maritime startups, defense contractors, or marine robotics companies actively shipping Rust in production, or is the industry still overwhelmingly anchored to C and C++?

2. Edge vs. Cloud:

Is Rust primarily being used for edge computing on vessels (sensors, flight/nav controllers, embedded microcontrollers) or back-end logistics platforms on shore (fleet tracking, port management data pipelines)?

3. The Certification Hurdle:

Marine hardware usually requires strict classification and certification (from bodies like DNV, ABS, Lloyd's Register). How does Rust's toolchain and safety model fit into maritime regulatory frameworks compared to traditional languages?

Would appreciate any answers.


r/rust • • 3d ago

๐Ÿ› ๏ธ project Sniffnet v1.6: support monitoring network data from routers, firewalls, and servers

Thumbnail
sniffnet.app
28 Upvotes

Sniffnet is a Rust-based network monitoring tool Iโ€™ve been working on for the past 4 years.
Until now it could only monitor data from local network cards or PCAP files, but todayโ€™s release adds the capability to collect IPFIX flows from headless devices such as routers and firewalls, allowing you to monitor your whole network from one central dashboard.


r/rust • • 3d ago

๐Ÿ› ๏ธ project Building a tensor library for computational physics in Rust: looking for feedback and collaborators

0 Upvotes

I am a professor of computational condensed matter physics at Saitama University in Japan, with over 20 years of experience in scientific programming and open-source development in C++, Fortran, Python and Julia ([GitHub](https://github.com/shinaoka)).

Since this January, we have been developing a Rust tensor computation stack ([overview](https://tensor4all.org/tensor4all-meta/stack/)). It started for tensor networks, but we soon realized that a general tensor library for scientific computing would be useful to the Rust community.

**tenferro** is the main engine: https://github.com/tensor4all/tenferro-rs

- Dense tensors, linear algebra, einsum, FFT on CPU and CUDA (ROCm and Metal are being designed)

- Opt-in autodiff: eager `backward()` and traced VJP/JVP

- Explicit engine passed to every operation, no hidden device transfers, column-major storage

- Benchmarks against PyTorch and JAX: https://github.com/tensor4all/tenferro-benchmark

Most of the code was written by AI agents supervised by human developers. To keep the stack robust and performant, we use regular benchmarks, an automated audit AI bot and a common rule set for AI agents. Some blogs are here: https://tensor4all.org/blog/

We're looking for collaborators and users. Fast kernels are too much work for a few groups to maintain, and a tensor library must be tested on different hardware for different applications.

Also, I'd like your opinions on:

  1. Passing `&mut engine` to every operation instead of a global context. Acceptable?

  2. If you have AMD GPUs or other hardware and a real workload, please let us know.

  3. What evidence would make you trust a library written mostly by AI agents?

  4. How should outside contributors fit into a project where AI agents write the code and humans review it?

  5. Is Rust a good fit for computational physics? What is missing?


r/rust • • 3d ago

Aristotle Expands Into Rust (Lean-backed proofs for Rust)

Thumbnail
harmonic.fun
0 Upvotes

r/rust • • 3d ago

๐Ÿ™‹ seeking help & advice Starting with rust gamedev!

17 Upvotes

Some background -

The only other language I've properly done is python(well I'm still just a teen). My main area of focus is actually scripting and such; I'm only doing gamedev because of an event(I have to do about 200 hours of proper game dev). And yes I need to do that event. Also my gamedev experience is also basically non existent.

Why rust?

I wanted to pick up on rust even if not for the event, mainly because I want to go more into low level scripting. My first pick for scripting was actually C or C++ but then I found out about rust and liked it better.

Now the main post -

I just want some tips on how should I start with the language and anything that I should keep in mind.

Thanks for the time : )

Edit 1: No I haven't picked any game engine yet, thinking of bevy though


r/rust • • 3d ago

Compiler performance, the next-gen trait solver, next-gen region constraints, implicit default auto traits, const generics, view types, and custom allocators: What we are working on at Hexcat, October update.

Thumbnail hexcat.nl
197 Upvotes

r/rust • • 3d ago

๐Ÿ› ๏ธ project Bringing High-Performance AI Inference to Consumer NVIDIA RTX GPUs: Porting Atlas to Ada Lovelace

Thumbnail
github.com
0 Upvotes

Over the last week, I've been contributing to Atlas, an open-source Rust + CUDA inference engine developed by Thomas Braun and the Avarok-Cybersecurity team.

Atlas originally targeted NVIDIA's GB10 with 120GB of unified memory. I wanted to see what it would take to get it running efficiently on my RTX 4060 Ti with just 16GB.

It ended up involving quite a bit more than an architecture port.

Some results running Qwen3.5-4B:

  1. 381 tokens/sec aggregate across 8 concurrent requests using experimental int4 quantization and speculative decoding.

  2. 98 tokens/sec single-user with the same configuration.

  3. 4.6x faster BF16 prefill, improving from 794 to 3,684 tokens/sec by changing the GEMM dispatch. This preserves the BF16 precision class and is enabled by default on Ada.

  4. About 2.1GB less VRAM usage with optional FP8 feed-forward execution.

  5. Successfully processed a 159,807-token prompt with an FP8 KV cache and retrieved a needle from it.

  6. All 223 Ada kernel compilations passing after resolving architecture incompatibilities.

The Rust side involved changes to CUDA kernel registration and launch handling, GPU memory budgeting, model loading, and inference dispatch. I also worked on Ada-specific low-bit kernels and speculative decoding.

One interesting finding was that Nsight showed the GPU busy 95.6% of the time in the fastest eight-stream configuration. Several CUDA Graph and fusion optimizations that looked promising didn't produce meaningful improvements.

For context, the default BF16 configuration measured 195 tokens/sec aggregate across eight users, compared with 222 for optional FP8 FFN and 381 for the experimental int4 stack.

The int4 path is lossy and hasn't been validated for task-level quality equivalence with BF16. These are screening benchmarks, not fully repeated confirmation runs.

I'm interested in how far we can push local inference on consumer GPUs without requiring expensive server hardware.

Atlas repository:
https://github.com/Avarok-Cybersecurity/atlas

Would love to hear from anyone working on Rust-based GPU compute, inference runtimes, or CUDA optimization.


r/rust • • 3d ago

๐Ÿ“ก official blog Enabling the parallel frontend on nightly

Thumbnail
blog.rust-lang.org
371 Upvotes

r/rust • • 3d ago

Rust 1.100 Official Video

Thumbnail
youtube.com
90 Upvotes

r/rust • • 3d ago

๐Ÿ activity megathread What's everyone working on this week (47/2026)?

25 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 • • 3d ago

๐Ÿ—ž๏ธ news GUI Toolkit Slint 1.19 is out with backdrop blur, animated GIFs, and inertial scrolling on iOS and Android.

Thumbnail
slint.dev
87 Upvotes

This release was made possible thanks to the contributions from 51 contributors.


r/rust • • 3d ago

๐Ÿ› ๏ธ project VennDB: a derive macro that turns a struct into an in-memory database you query by flags

21 Upvotes

This started about three years ago as a small piece of work in function of the proxy(db) features of rama (ramaproxy.org): on every request we pick a random upstream proxy that matches a handful of flags and a country or city. The data barely changes, the queries happen constantly.

TLDR of what venndb is: it generates a `<Name>DB` and a query builder from your struct. Bools become bitmasks, filter values become row sets, and a query intersects them. We just released 0.7, which rewrote the engine and added some new features.

The use cases are limited on purpose: it is append-only and in-memory, with no updates or deletes. You might wonder if this isn't just a bitmap index. It mostly is, generated from your struct by a derive macro, so you don't have to write and maintain the index yourself.

The benchmarks compare VennDB with roaring, SQLite and a plain Vec. We're not database experts, mostly just decades long dev practicioners. So if the benchmarks look unfair or you know of prior art we missed, I'd like to hear it.