# Unsafe assertion invariants

**URL:** <https://internals.rust-lang.org/t/unsafe-assertion-invariants/23206>\
**Category:** Uncategorized\
**Created:** [July 10, 2025, 9:15am UTC](https://internals.rust-lang.org/t/unsafe-assertion-invariants/23206 "2025-07-10T09:15:08Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![vague](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/vague/32/9179_2.png) [@vague](https://internals.rust-lang.org/u/vague)\
**Post date:** [July 18, 2025, 2:33am UTC](https://internals.rust-lang.org/t/unsafe-assertion-invariants/23206/8 "2025-07-18T02:33:31Z")

</div>

> [@CodesInChaos](#):
>
> Still, I think adding a machine readable way to specify pre- and post-conditions (be they safe or unsafe) could be valuable.

> [@adic3x](#):
>
> My proposal is not only about automatic validation. Putting assertions in the documentation also makes the feature easier to use.

This is what [tag-std](https://github.com/Artisan-Lab/tag-std) wants to solve. We want a safety property mechanism that is standardized on writing safety documentation and propeties are auto checked.

 ![](https://us1.discourse-cdn.com/flex002/uploads/rustlang/original/2X/8/8df0560183a8d53b17f1bac570fd8a5c9c052d15.png)

 ![](https://us1.discourse-cdn.com/flex002/uploads/rustlang/original/2X/7/78dacc4c3145c0368cf136dfa1bb899307f9a16b.png)

I'm writing safety-tool and [gathering some ideas](https://github.com/Artisan-Lab/tag-std/issues), and other team members are studying on [Annotating and Auditing the Safety Properties of Unsafe Rust](https://arxiv.org/abs/2504.21312).

We're also extending the efforts to Rust for Linux and Asterinas OS.

~~I'm also on the way to propose a Pre-RFC on IRLO soon.~~

Ideas and feedbacks are welcome!

* * *

P.S. The syntax is inspired by [this](https://internals.rust-lang.org/t/ability-to-call-unsafe-functions-without-curly-brackets/19635/22) scottmcm's comment.

* * *

Update: Pre-RFC is [here](https://internals.rust-lang.org/t/pre-rfc-safety-property-system/23252).

---

_[View the full topic](https://internals.rust-lang.org/t/unsafe-assertion-invariants/23206)._
