r/rust • clippy · twir · rust · mutagen · flamer · overflower · bytecount • 4d ago

🙋 questions megathread Hey Rustaceans! Got a question? Ask here (40/2026)!

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.

10 Upvotes

10 comments sorted by

2

u/Dean_Roddey 4d ago

Maybe not the best place to ask, but the other WGPU'ish fora I saw seemed dead as doornails...

I'm trying to get shader debugging enabled (Kubuntu, WGPU v30 over Vulkan 1.4.x.) I've got the validation layers installed and enabled (they show up in vulkaninfo.) I've enabled the vulkan and wgsl options on wgpu.

I've got a little rectangle drawing pipeline program working to start experimenting, but I really need some shader debugging. Every bit of documentation I see says that I have to enable the Features::DEBUG_PRINTF and InstanceFlags::DEBUG_PRINTF flags, but neither exists. There's an InstanceFlags::DEBUG, there's nothing remotely debuggy in the Features flags that I can see.

There may be other issues still, but that's the most obvious one so far. If I attempt to enable wgu_debug_printf in the shader, I get an error that it's an unknown extension.

Any suggestions would be appreciated. There's SO much outdated info that it's real struggle sometimes to know where I stand.

2

u/someanonbrit 2d ago

Hopefully a quick / simple question, and I'd be very happy to be pointed at docs as an answer with a couple of keywords for what to watch out for.

I've pretty new to rust. I want to write a very simple UI library as a learning tool.

Assume I have a generic counting widget that supports increment, decrement and reset, and some model that is running a stateful calculation like a fractal or even just a canvas of a single colour, that has a 'colour' field that can be updated at any time from the UI and will affect the ongoing calculation.

How do I model this in code? It's about as trivial an example that I can come up with for what I haven't gotten my head around with ownership. Nothing I come up with feels elegant, so I am guessing that I'm missing something

2

u/DidingasLushis 2d ago

I remember someone shared a website which was a quest like game for rustlings/leetcode rust questions with scores and progression and special events. Does anyone remember what it was called?

1

u/forsaken_browsing 4d ago

The playground link is a lifesaver honestly, half the time I paste my weird lifetime error in there and suddenly it makes sense, or at least the error message gets marginally less cryptic.

1

u/Iwisp360 4d ago

Is it ok that I don't struggle with the borrow checker?

1

u/Iwisp360 4d ago

I mean I'm a Clone hater and avoid it every time I can

1

u/SirKastic23 3d ago

what kind of code are you writing?

1

u/Iwisp360 3d ago

Uhh servers and libraries with ffi bindings

1

u/SirKastic23 3d ago

Yeah maybe it's the domain you're writing in. When I worked with web backends I would almost never have to deal with lifetimes

2

u/Iwisp360 3d ago

What would be a project where referencing data is a must?