Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Constants and dyn-compatibility
Is there any hard reason why traits with constants inside cannot be made dyn-compatible
?
From what I understand it should be possible to build a vtable with constants inside.
Is it something that just wasn't implemented or is the solution non-obvious for some reason?
As a workaround I currently implemented a constant through a method taking &self
. It works, but it can be abused to return a different value on further invocations.
3 posts - 2 participants
🏷️ Rust_feed