Awful Rust snippets for fun and profit

Description
seen something awful and want to post it here? send it to @goldsteinq
Advertising
We recommend to visit

Community chat: https://t.me/hamster_kombat_chat_2

Twitter: x.com/hamster_kombat

YouTube: https://www.youtube.com/@HamsterKombat_Official

Bot: https://t.me/hamster_kombat_bot
Game: https://t.me/hamster_kombat_bot/

Last updated 3 months, 1 week ago

Your easy, fun crypto trading app for buying and trading any crypto on the market

Last updated 3 months ago

Turn your endless taps into a financial tool.
Join @tapswap_bot


Collaboration - @taping_Guru

Last updated 3 days, 5 hours ago

2 months ago
macros can close over their environment, …

macros can close over their environment, “breaking” hygiene

playground

I’d like to give a link to documentation here, but I don’t think this is actually documented anywhere? neither reference nor TLBORM mention it as far as I can see

UPD: ferrocene specification

2 months, 3 weeks ago
cyclic associated types are okay under …

cyclic associated types are okay under lazy normalization / next solver
(you need ?Sized though, otherwise it tries to prove Assoc: Sized and fails)

godbolt
tracking issue

4 months ago

wrote down some thoughts about error handling, specifically a pattern that I call “progress pattern” (probably it has another name somewhere, but I’m not aware of it)
https://github.com/GoldsteinE/gh-blog/blob/master/error_progress/README.md
thanks to @meowaffle for reviewing this!

(btw, are y’all ok with breaking the format like this sometimes?)

5 months, 2 weeks ago

my fix for this problem was merged and will be stable in rustc 1.81, unless something goes wrong
https://github.com/rust-lang/rust/pull/123043

GitHub

Disable dead variant removal for `#[repr(C)]` enums. by GoldsteinE · Pull Request #123043 · rust-lang/rust

This prevents removing dead branches from a #[repr(C)] enum (they now get discriminants allocated as if they were inhabited). Implementation notes: ABI of something like #[repr(C)] enum Foo { F...

9 months ago

found this one while thinking about size of uninhabited types. Ralf seems to agree it’s a bug, so the patch will probably be accepted
playground
UCG issue
proposed patch

We recommend to visit

Community chat: https://t.me/hamster_kombat_chat_2

Twitter: x.com/hamster_kombat

YouTube: https://www.youtube.com/@HamsterKombat_Official

Bot: https://t.me/hamster_kombat_bot
Game: https://t.me/hamster_kombat_bot/

Last updated 3 months, 1 week ago

Your easy, fun crypto trading app for buying and trading any crypto on the market

Last updated 3 months ago

Turn your endless taps into a financial tool.
Join @tapswap_bot


Collaboration - @taping_Guru

Last updated 3 days, 5 hours ago