Elektrine lite

← Feed

@kasrababaei@mastodon.social

Post #2625603

2026-05-02 09:31 UTC

@mattiem@mastodon.social 2. In a closure that mutates self when neither self nor the closure is Sendable, is it possible to tell the compiler that I don’t care about the state of self without making the whole object, ie self, unchecked Sendable? Example: a VM that invokes a closure which fetches something from the BE, and then mutates some value on self.

Replies (1)

  • @mattiem@mastodon.social 2026-05-02 09:44

    @kasrababaei@mastodon.social yes. You can use a local “noniolsated(unsafe)”. This is a very useful technique. But like with all unsafe opt-outs, have to use with care.

    Open ##2625604