Three years ago, the As-Any Hack was shared on this blog to make upcasting to supertraits work on stable Rust. Despite DebugAny inheriting from Any, Rust previously did not allow methods from Any to be used on dyn DebugAny, resulting in compile errors when trying to use downcast_ref. However, as of Rust 1.86, this issue has been fixed, allowing the cast to work correctly. This fix is currently in the beta channel and will soon be available in the stable release, eliminating the need for old hacks. This development marks a significant improvement in Rust programming.
https://lucumr.pocoo.org/2025/3/27/any-upcast/