Skip to content

Instantly share code, notes, and snippets.

@ia0
ia0 / main.md
Last active March 17, 2024 16:08
Writing down my mental model of unsafe

Writing down my mental model of unsafe

DEPRECATION WARNING: This document is now deprecated. The new version is available here.

TLDR: All language constructs regarding unsafe Rust (including those that do not exist yet) can be explained by a single concept: the proof type (see first section). Understanding this concept is enough to understand unsafe.

I always assumed the content of this document to be obvious, but came to realize while discussing