# Const arguments

**URL:** <https://internals.rust-lang.org/t/const-arguments/7811>\
**Category:** language design\
**Created:** [June 27, 2018, 12:22pm UTC](https://internals.rust-lang.org/t/const-arguments/7811 "2018-06-27T12:22:57Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Soni](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Soni](https://internals.rust-lang.org/u/Soni)\
**Post date:** [June 29, 2018, 1:22pm UTC](https://internals.rust-lang.org/t/const-arguments/7811/21 "2018-06-29T13:22:01Z")

</div>

the idea is to use this as a stepping stone for const generics

---

<div class="post-metadata">

**Author:** ![Ixrec](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ixrec/32/6754_2.png) [@Ixrec](https://internals.rust-lang.org/u/Ixrec)\
**Post date:** [June 30, 2018, 2:49am UTC](https://internals.rust-lang.org/t/const-arguments/7811/22 "2018-06-30T02:49:57Z")

</div>

Simultaneous Art from C++: [http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1045r0.html](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1045r0.html)

---

<div class="post-metadata">

**Author:** ![Soni](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@Soni](https://internals.rust-lang.org/u/Soni)\
**Post date:** [June 30, 2018, 3:27pm UTC](https://internals.rust-lang.org/t/const-arguments/7811/23 "2018-06-30T15:27:28Z")

</div>

basically I want a very simple and very limited form of const generics.

They’d only work in functions. they’d only be const-checked when calling the function, but inside the function it’d be treated like a non-const as far as everything is concerned. This is extremely limited, but compatible with const generics, so if we do get const generics we can then “fix” this, and make it work like const generics.

It would be a stepping stone for const generics, and would introduce an useful behavior - erroring if an argument isn’t const. It may not seem very useful but it really is. I’m working on some code that uses an argument to emit notifications, and we expect the argument to be fixed at compile-time.

Note that “const mut” would NOT be available, as that would be incompatible with const generics.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:30am UTC](https://internals.rust-lang.org/t/const-arguments/7811/24 "2019-03-25T08:30:26Z")

</div>

Closed on March 25, 2019, 8:30am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://internals.rust-lang.org/t/const-arguments/7811.md?page=1)
