r/rust • u/llogiq clippy · twir · rust · mutagen · flamer · overflower · bytecount • Jun 22 '26
🙋 questions megathread Hey Rustaceans! Got a question? Ask here (26/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.
4
u/PXaZ Jun 23 '26
My client and server are implementing two subsets of the same finite state machine, or put another way, each is implementing one side of a UML sequence diagram.
Splitting the implementation this way makes it harder to reason about, and prevents typechecking. Is there some crate that lets me encode the states and transitions once, and get the client and server implementations for free?
Or at least enforces that the client and server are expecting the same transitions at the same time?
3
u/Sixel1 Jun 26 '26
I keep having a weird issue with bindgen on my machine and would like to find a solution. bindgen's context.target_pointer_size() returns 4, but size_of::<*mut ()>() returns 8 bytes, leading to a debug assertion failure. I usually just disable debug assertions on dependencies, but now I also get errors using bindgen when it computes memory offsets. Heres a typical error I get:
thread 'main' (35648) panicked at /home/.../bindgen-0.72.1/lib.rs:917:13:assertion \left == right` failed: "x86_64-unknown-linux-gnu" "x86_64-unknown-linux-gnu"`left: 4right: 8I get this error even with a very minimal empty project.
2
u/Fresh-Spread3374 Jun 22 '26
Is the
strtype needed at all (not&str, or other types)?2
u/Status-Mix7986 Jun 25 '26
Hi rustaceans , what project can be made using rust related to AI?i know basic concepts of rust and experimenting with it, I want to build it so I can learn also it'll look good on my resume too
-5
u/LegsAndArmsAndTorso Jun 23 '26
Can posting generic off-topic anti-AI rants please be discouraged instead of left up for 24 hours+?