![](https://lemmy.magnor.ovh/api/v3/image_proxy?url=https%3A%2F%2Fpawb.social%2Fpictrs%2Fimage%2F531f76a4-b4f3-4eaf-b944-f4228781e2fd.png)
![](https://lemmy.magnor.ovh/api/v3/image_proxy?url=https%3A%2F%2Fprogramming.dev%2Fpictrs%2Fimage%2F8140dda6-9512-4297-ac17-d303638c90a6.png)
For anyone who is confused: This is exploiting an old soundness bug in the Rust compiler that is still present. The GitHub issue page has this comment from maintainers:
we already had a crate published on crates.io before which used this bug to transmute in safe code, see #25860 (comment).
this issue is a priority to fix for the types team and has been so for years now. there is a reason for why it is not yet fixed. fixing it relies on where-bounds on binders which are blocked on the next-generation trait solver. we are actively working on this and cannot fix the unsoundness before it’s done.
I assume you have already tried the official tutorials, but Go By Example is a great “learn by doing” kind of tutorial. Others that I found in a quick DDG search: