Old vtable example fails with: "error: untyped pointers are not allowed in constant" #77995
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-raw-pointers
Area: raw pointers, MaybeUninit, NonNull
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
While trying to play around with
raw::TraitObject
I found this thread internals.rust-lang.org/... and in particular this code example play.rust-lang.org/... which does not work anymore.Code
I tried this code:
I expected to see this happen:
I get the vtable as a const.
Instead, this happened:
error: untyped pointers are not allowed in constant
Version it worked on
Probably before c400f75
Edit: added PR number #71665
Version with regression
rustc 1.49.0-nightly (e160e5c 2020-10-14)
Any chance we can get the example code to compile again?
Is there a different way to get the vtable?
The text was updated successfully, but these errors were encountered: