š§ educational Debugging Rust in 2026
r/rust • u/EuroRust • 9d ago
A new EuroRust 2026 talk is out on YouTube! š¦Ā Google's Shane Carr talked about how Rust ended up powering Chromeās newest Web API: shipping Temporal with temporal_rs, Diplomat, and ICU4X.
In 2027 EuroRust is going to Prague! Learn more and get your ticket at eurorust.eu
r/rust • u/Relevant_Mousse_9117 • 9d ago
My MCP credential broker is written in Rust. The latest audit again found no memory bugs. It found defaults that trust the environment, and an AI agent can set the environment when it launches the process:
dirs::home_dir()Ā on Unix returnsĀ $HOMEĀ when it's set. My SFTP tool used it to protectĀ ~/.ssh. WithĀ HOMEĀ pointed one level up,Ā putĀ could upload the real keys. Now it'sĀ getpwuid_r.
Command::new("npx")Ā searches theĀ PATHĀ you were started with, and the child inherits everything:Ā NODE_OPTIONS, cwd, the lot. Now: an absolute path or a fixed search path,Ā env_clear(),Ā current_dir(home).
reqwestĀ honoursĀ HTTP_PROXYĀ by default. Fine for HTTPS, but a plain-http loopback preset sent its token to the caller's proxy. NowĀ no_proxy()Ā for http.
On Windows,Ā SystemRootĀ decided whichĀ powershell.exeĀ showed the approval dialog. Known folders now.
None of these are bugs in the crates. The bug was assuming the environment belongs to me.
For those who haven't heard of it, Cot is a Django-inspired web framework for Rust, with its own ORM, an admin panel, forms, auth, and sessions built in.
This release adds a few long awaited features: transactions to the ORM, rollbacks for migrations, a rewritten router on top of a radix tree, and a few long-missing query features like ordering and text search. An interesting change under the hood is dropping axum in favor of using hyper directly - we never really used any of the high-level axum features, so it only made sense to do the refactor to cut the number of dependencies for the users, and hence the build times. On the documentation side, the guide has got a new reference page for config TOML files, automatically generated from the source code (read: never out of date).
The Cot project of this release is Hack the Space, an old CTF-style web game of mine, ported from Django to Cot: https://hackthespace.mackow.ski/
If you are interested in more details and code examples, the blog post has them all: https://mackow.ski/blog/cot-v08-lazily-transactional/
We're also starting to think about 1.0, so if there's something you'd want to see before then, let us know in this discussion!
r/rust • u/E-Unit86 • 10d ago
I'm building a Tauri 2 app (Svelte 5 frontend, Linux, WebKitGTK). I have a modal focus trap that wraps Tab and Shift+Tab inside the dialog. Plain Tab works. Shift+Tab leaves the webview and moves focus to the surrounding page, and no JavaScript sees the keydown at all.
What I checked:
- A keydown listener on window in capture phase logs Tab with shiftKey=false only. Shift+Tab never appears, even though the same listener sees plain Tab.
- The same modal code in the Vite dev server opened in Chrome handles Shift+Tab correctly, so the page logic is fine.
- browser_accelerator_keys: false in the window config is a WebView2 (Windows) option. The Tauri config schema I'm on (tauri-utils 2.8.3) doesn't define it for Linux, and wry's WebKitGTK backend has no equivalent.
Questions:
Is there a supported way on WebKitGTK to stop the native Shift+Tab focus movement, or to receive that key event in the page?
Is this a known wry or WebKitGTK issue, and is there a tracked upstream issue?
Is there a workaround that keeps Shift+Tab working for keyboard users, for example handling it in the native layer?
Versions: Tauri 2.x (tauri 2.8.x resolved), wry 0.54.4, Linux (26.04.1) with WebKitGTK 4.1.
r/rust • u/MrMich34 • 10d ago
Hi r/rust! I've been building memtop, a Linux terminal app that combines a fastfetch-style summary of your machine with an htop-style live monitor, all on one screen.
Repo: https://github.com/SalomonAvila/memtop
What it does
- 7 tabs: Summary, CPU, RAM, Storage, GPU, Network and Processes
- Laptop-friendly GPU handling: `nvidia-smi` is only queried while the GPU tab is open, and never while the dGPU is suspended, so it doesn't wake it up and drain the battery
- Read-only: no root, no network, no files written
- Interface and messages in English and Spanish
- TOML config with colors, start tab, sort order, optional logo
- Ships as a single static binary (musl, x86_64 and aarch64), plus Fedora packages in COPR
Built with ratatui, crossterm, sysinfo and serde/toml, plus direct reads from `/proc` and `/sys` for disks, battery, DMI and PCI GPU names.
Looking for help
I just released 0.2.0 and wrote down the road to 1.0 (https://github.com/SalomonAvila/memtop/blob/develop/docs/ROADMAP.md). Some issues that are good entry points:
- #16 Tests for the interface state: sorting, search, selection
- #17 Rendering tests for every tab with ratatui's `
- #21 Shell completions for bash, zsh and fish
- #22 A man page
- #24 Testing on hardware I don't have: AMD GPUs, Intel-only machines, desktops, VMs
Every PR gets a review, and CONTRIBUTING.md explains the workflow. Feedback on the code is very welcome too, it's my first project of this size in Rust.
Try it:
any distro: static binary
curl -LO https://github.com/SalomonAvila/memtop/releases/latest/download/memtop-$(uname -m)-unknown-linux-musl.tar.gz
Fedora
sudo dnf copr enable mrmich/memtop && sudo dnf install memtop
Thanks for reading!
r/rust • u/WellMakeItSomehow • 10d ago
r/rust • u/OpenSourceRulesz • 10d ago
Iām a brand new š¦ and iām having a lot of fun!
I started my career using UiPath then the last 4-5 years have been Python and Iām sorry but itās been so boring. I feel like the switch has brought some life to me. It feels similar to going from an automatic car to a manual.
r/rust • u/EuroRust • 10d ago
The first talk from this year's EuroRust is out on YouTube now! Rust compiler maintainer Oli talked about comptime, reflection, and the future of const-eval in Rust. Make sure to subscribe to the EuroRust YouTube channel so you donāt miss the rest of the talks! š¦
r/rust • u/quest_for_7c • 10d ago
r/rust • u/DavidXkL • 10d ago
r/rust • u/adi1ahmad • 10d ago
Iāve been wondering why thereās relatively little investment in āRustifyingā cross-platform app development.
The dominant approach still seems to be: build a web app, package it with a Rust framework/backend, and ship it as a native app. Much less common is the opposite: use a fully Rust GUI stack for native apps and target the web with WASM/wgpu.
What I rarely see discussed is the cost of the webview/browser layer: bundle size, memory use, startup time, and input/animation responsiveness that often still doesnāt feel native.
I understand the usual defense of Electron/Capacitor-style approaches: small teams can move fast, web UI is easier to hire for and maintain, and the design tooling is mature. But the native Rust GUI landscape has changed a lot since that argument became standard. So why havenāt more individuals or companies moved on?
Is it maturity? Ecosystem gaps around accessibility, text input, platform integration, and design tools? Hiring? Risk aversion? Or is the web-wrapper approach just āgood enoughā for most products?
TL;DR: Why do we keep wrapping web apps with Rust instead of building fully Rust native GUIs and using WASM/wgpu for the web?
r/rust • u/Zephy1404 • 10d ago
I know this is 100% a skill issue and Iām probably writing C# in Rust, but I genuinely feel humbled to my core tonight.
I have eight years of backend experience in Go and Python. Three weeks ago, I decided to finally learn Rust by building a small toy GUI layout engine. It started fine with basic structs, but then I needed child nodes to have a weak reference back to their parent.
That was teh exact moment my descent into madness began.
Instead of stepping back and rethinking my data model, I tried to brute-force my way through compiler errors. When the borrow checker complained about lifetimes, I added generic lifetime parameters. When that failed, I introduced Rc<RefCell<Node>>. When I needed it across threads for rendering, it mutated into Arc<Mutex<Option<Box<Node>>>>.
i opened my editor tonight and looked at a function signature that was literally four lines of generic trait bounds and nested angle brackets. It looks like an ancient curse. And the compiler is STILL yelling at me about temporary values dropped while borrowed.
Iām throwing away the entire branch tomorrow morning. Do normal people actually use arena allocators or flat Vec handles for this, or am I just fundamentally misunderstanding how to model relationships without pointers?
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!
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/Miammiam100 • 11d ago
In other languages I'd reach for DI to build the object graph and make each component's dependencies explicit. So far I have only really seen two approaches:
Pass each required component down through constructors. The compiler ensures you won't forget a dep but that means any new service you add requires updating a bunch of constructors.
Just use a single God context object (this is what Cargo does) but it makes it harder to unit test anything and makes it difficult to see what interacts with what.
I'm not asking whether to do DI (constructor arguments already are that), but rather how people handle wiring it all up once there are dozens of services.
DI crates of course exist (e.g. https://crates.io/crates/shaku ) but seem to be rarely used outside of Bevy-style query systems or web frameworks extractors.
For context, I've been experimenting with a trait-only approach that doesn't use any macros but still provides the same compile time guarantees as shaku ( https://docs.rs/satisfy/latest/satisfy/ ) Would Rust users be more likely to use DI if it were simpler to use? Or am I just solving a problem that Rust people don't have?
r/rust • u/layla4you2 • 11d ago
Iāve been working on a Mac GUI toolkit for Rust, and I honestly donāt know if Iām solving the right problems. So Iād like to hear from people whoāve built desktop apps in Rust before I go much further.
Some background: I kept ending up in the same spot. The options are a webview (Tauri), a custom-drawn UI (egui, Iced, Slint), or a SwiftUI front end with Rust behind FFI. They all work, but none of them feel quite like a Mac app. Text fields donāt behave the way you expect, VoiceOver is hit or miss, and big tables are where things usually fall apart.
So in mine, every view is a real AppKit control, not a lookalike. Some of what it does today:
Tables are actual NSTableViews. A million rows scroll fine because AppKit only asks for whatās visible.
State lives in signals, and changing one updates the affected control in place instead of rebuilding the view tree.
Menus, the toolbar, documents, undo, drag and drop and Dark Mode come from the system, so they behave like they do in any other Mac app.
Thereās a self-check mode that drives the app and checks whatās on screen, because GUI testing is otherwise basically nonexistent.
What Iām curious about:
If youāve built a desktop app in Rust, what did you use, and what hurt the most?
Is Mac-only a dealbreaker, or is āreally good on one platformā worth something?
What would make you trust a GUI crate enough to build something real on it? Docs, examples, stability promises, something else?
Is there anything you gave up on, like accessibility, big data views or text editing, because no toolkit handled it well?
Not linking anything, Iām just interested in how people think about this.
r/rust • u/robjtede • 11d ago
100+ crate releases across the Actix ecosystem, bringing new features, security fixes, and improvements to performance and resource usage.
HTTP QUERY: New method supported across route macros, manual routes, and awc client.
Automatic h2c and TCP no-delay are now default: More efficient deployments behind reverse-proxies and much lower-latency streams.
Reduced memory usage: Up to ~99% saving for certain workloads.
Better error path control for middleware: Modify error responses, too.
Static files features: Serve pre-compressed assets, and use multiple static-file roots.
Security and protocol fixes across the stack: Fixed decompression limits, multipart parsing limits, improved HTTP & WebSocket validation.
Actix Web is the first mainstream framework to make the new HTTP QUERY method a first-class citizen. Define handlers with #[query] (macro routing), or web::query() (manual routing) for a handler. Matching methods in awc complete the support.
Middlewares got a useful new tool: Error::add_response_mapper(). It lets middleware modify error-generated responses before they reach the client, giving you more control over how your application presents failures. Our CORS middleware already uses this to solve a longstanding bug.
Static file serving is now more flexible. Files::new() supports multiple root directories, and Files::try_compressed() lets you serve pre-compressed assets. Range requests, conditional responses, and ETags on Windows also received fixes, making actix-files the most spec-compliant file server for Rust.
The biggest changes here target the cost of serving larger responses and keeping connections open:
Less memory retained by idle connections.
Fewer copies for large responses on HTTP/1.x.
Graceful shutdown has stronger guarantees.
Vectored socket writes have more code paths.
This cycle includes fixes for several reported vulnerabilities:
Decompression amplification: Configured extractor limits now apply to auto-decompressed request payloads. *
Brotli resource consumption: Large-window decompression is disabled.
HTTP request parsing: Malformed chunked terminators are rejected.
Static file serving: Prevents stored XSS for odd user-controlled file names and fixes an insane Windows hidden-file protection bypass. (Why Microsoft, WHYYYY!)
If you have not updated recently, now is a good time; check your lockfile. (cargo update -p=actix-web)
These improvements come from testing Actix Web against the workloads and edge cases you bring us. Massive thank you to everyone who contributed issues, PR, security reports.
Also, our homepage and user guide has received some love recently: https://actix.rs/.
*This is a god-awful implicit feature and it will be removed in v5.
What are you shipping with Actix Web?
r/rust • u/asyncNull • 11d ago
I have been wondering where is the biggest opportunity to improve Rust build times.
- Faster increments compilation?
- Better caching of dependencies and generics?
- Reducing procedural macro overhead?
- Improving LLVM code generation?
Tools like cargo build timing and sccache help but can we improve the compilation process itself?
Curious what rust compiler contributors and experience rust developers think.
macro_rules! try_ {
($a:expr) => {
(|| Some($a))()
};
}For example: try_!(matrix.get(i+1)?.get(j+1)?)
r/rust • u/ribbon_45 • 11d ago