this post was submitted on 08 Jun 2025
294 points (97.4% liked)

Programmer Humor

23995 readers
1393 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
[โ€“] fnrir@lemmy.blahaj.zone 5 points 21 hours ago (1 children)

Rust: do you mean Self or self?

[โ€“] d_k_bo@feddit.org 5 points 20 hours ago* (last edited 20 hours ago)

this is commonly used with a similar meaning to self in cases where self can't be used because it is a reserved keyword.

Example:

    fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<St1::Item>> {
        let this = self.project();
        this.inner.poll_next(cx)
    }

https://github.com/rust-lang/futures-rs/blob/master/futures-util/src/stream/select.rs#L113-L116