In the Rust documentation for assert here assert in std - Rust it is stated that " Unsafe code relies on assert! to enforce run-time invariants that, if violated could lead to unsafety." This seems to counter my concept of systems programming languages not inserting things implicitly. The section on unsafe code in the rust book also makes no mentions of the assert macro being inserted.
Am I misunderstanding the sentence and assert! is not actually inserted in unsafe code, or am I not understanding the need for such statements?
I think this would be more clear as "unsafe code often relies on assert! to...". It should be read as descriptive, not prescriptive - unsafe code is not required to do this, and the compiler does not insert assert!. It's just describing the fact that most unsafe code segments do use assert! and friends to validate data before using it in unsafe code blocks.