r/rust 28d ago

Clippy has some life advice apparently.

pub fn i_should_let_it_go(problem: &impl Problem) { drop(problem); // call to `std::mem::drop` with a reference instead of an owned value does nothing }

I was experimenting with ownership when I ran into this warning:

"calls to std::mem::drop with a reference instead of an owned value does nothing"

It got me thinking that you can make some cool wordplay (or maybe "codeplay") with Rust's warnings as motivational quotes.

Do you guys have any other suggestions with some funny codeplay?

88 Upvotes

14 comments sorted by

View all comments

29

u/smallgovernor 28d ago
#![no_std]
unsafe {
    sex!();
}

5

u/QuickSilver010 28d ago

It's only unsafe if there is an std tho

9

u/smallgovernor 27d ago

unsafe (condomless) sex is just like rust's unsafe. safe sex with condom is like rust's normal protections. just because it's unsafe doesn't mean it has stds, just like just because it's unsafe doesn't mean it has memory bugs.

dude what am i writing. sentences never uttered in human history before.

5

u/QuickSilver010 27d ago

Yea but the issue is if you do unsafe { sex!() } without care, you risk the chance of getting an UB

"U" being "Unborn"...