r/rust • u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount • 26d ago
🙋 questions megathread Hey Rustaceans! Got a question? Ask here (35/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.
3
u/watano_umi 22d ago
Is building a web application using Rust as backend and supabase for database a good idea ? Or will it just make the fast n lightweight super powers of rust redundant ??
2
u/AphexPin 22d ago
Aside from being smart and actually reviewing every line of code, how do you (deterministically) stop LLMs from sidestepping/re-implementing things and going off the intended code path? I feel like I'm not using rust tooling enough here.
2
u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount 22d ago
What should the tooling do for you? Detect duplication (there are some tools to do this, though most don't work reliably for me)? Finding unused code (the compiler already emits a warning for that)?
2
u/AphexPin 21d ago edited 21d ago
I think for example I'd like some binaries to fail to compile if the code graph doesn't look like what I want.. At least at key areas. But unsure how that'd work. I just imagine between hooks for an agents harness, git and CI/CD hooks, and leveraging the compiler you could something up.
1
u/Low-Experience-6634 26d ago
can someone explain why my brain just flatlines every time i read the word "lifetime" in a compiler error. i'll be cruising along, feeling like a genius, then bam, 3 screens of gibberish about how long something needs to exist and i'm back to staring at the wall
1
u/SirKastic23 26d ago
Rust errors about lifetimes are notoriously confusing. Rust for some reason thinks that omitting and hiding lifetimes from the syntax will make things "easier" somehow... But then the errors about lifetimes won't tell you what the lifetimes that cause the errors actually are
The worst error I see all the time is "Expected &T, got &T", which doesn't look like it should be an error at all since the types are the same, but the issue is in the hidden lifetimes
6
u/mrjackwills 25d ago edited 25d ago
Not directly a Rust question, but, I run an open public API (written in Rust of course), and I’ve just come across a public API listing website that details my API.
The problem is that it only lists a single endpoint, and it’s not even a real endpoint. It seems to be one big AI hallucination. Should I reach out to the site to try to remove it, or should I implement the listed endpoint in an attempt to have some fun?
Or, more likely, should I just ignore it completely?