# Custom vtables with integers

**URL:** <https://users.rust-lang.org/t/custom-vtables-with-integers/78508>\
**Category:** help\
**Created:** [July 18, 2022, 1:23pm UTC](https://users.rust-lang.org/t/custom-vtables-with-integers/78508 "2022-07-18T13:23:38Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![steffahn](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/steffahn/32/47569_2.png) [@steffahn](https://users.rust-lang.org/u/steffahn)\
**Post date:** [July 18, 2022, 1:52pm UTC](https://users.rust-lang.org/t/custom-vtables-with-integers/78508/4 "2022-07-18T13:52:13Z")

</div>

On the other hand it makes sense that there are limitations beyond what that RFC wrote. You probably wouldn't want

```rust
let x: &u32 = &(panic!() as _);

```

to panic at compile time, even though

```rust
static X: &'static u32 = &(panic!() as _);

```

compiles somewhat successfully (at least until it reports that compile-time panic).

And even more non-trivial than simple panics, non-terminating (or slow) computations would be hard to handle in non-confusing ways. (E. g.: Should static promotion be _tried_ and then disregarding it becomes a silent fallback in case of panic or if evaluation is taking to long? But if hitting some evaluation limit turns into lifetime errors that would be weird and confusing.)

---

_[View the full topic](https://users.rust-lang.org/t/custom-vtables-with-integers/78508)._
