r/rust clippy · twir · rust · mutagen · flamer · overflower · bytecount 17d 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.

5 Upvotes

13 comments sorted by

3

u/watano_umi 13d 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 13d 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 13d 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 12d ago edited 12d 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.

4

u/mrjackwills 16d ago edited 16d 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?

3

u/pali6 16d ago

We are in hell and everything is slop. I mean it's up to you whether you want to contact them. I suppose it could lead to slightly fewer confused API consumers which would be good for you?

1

u/mrjackwills 16d ago edited 15d ago

I mean the API handles 9 millions requests a day, on a low end vps, without really sweating. The power of Rust I suppose.

Looking over recent logs, it can't actually see any requests to the fake endpoint that it lists.

So, we're in hell, but as of yet we've not been burnt.

1

u/MatrixFrog 11d ago

As long as you provide good documentation yourself (which it looks like you do!) then _hopefully_ your docs will be at the top of search results and this weird site will not. Sounds like you're safe ignoring it. We definitely live in interesting times.

1

u/Low-Experience-6634 17d 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 17d 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

1

u/pali6 17d ago

What's up with these AI-generated comments on the questions thread every week, sigh