# Idea: Static assertions

**URL:** <https://internals.rust-lang.org/t/idea-static-assertions/7753>\
**Category:** language design\
**Created:** [June 19, 2018, 2:45am UTC](https://internals.rust-lang.org/t/idea-static-assertions/7753 "2018-06-19T02:45:24Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![gbutler](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/gbutler/32/3670_2.png) [@gbutler](https://internals.rust-lang.org/u/gbutler)\
**Post date:** [June 19, 2018, 6:59pm UTC](https://internals.rust-lang.org/t/idea-static-assertions/7753/7 "2018-06-19T18:59:22Z")

</div>

> [@repax](#):
>
> If the predicate of some run-time values cannot be determined at compile time then a run-time assertion would have to be generated by the compiler. However, _if_ the predicate can be proved at compile time then the run-time check is unnecessary and is eliminated.

Yes, nice! And this could eventually lead to supporting something like this: [[Pre-RFC] Another take at clarifying `unsafe` semantics - #31 by gbutler](https://internals.rust-lang.org/t/pre-rfc-another-take-at-clarifying-unsafe-semantics/7041/31)

---

_[View the full topic](https://internals.rust-lang.org/t/idea-static-assertions/7753)._
