this post was submitted on 12 Mar 2025
702 points (98.5% liked)

Programmer Humor

21564 readers
2964 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] calcopiritus@lemmy.world 1 points 4 days ago
unsafe fn<'a, T>(p: &'a T) -> &'static mut T {
    p as *cons T as *mut T as &'static mut T
}

It is a bit more than just dereferencing raw pointers.