"The problem? Even though DebugAny inherits from Any, Rust wouldn't let you use methods from Any on a dyn DebugAny."
"But there is good news! As of Rust 1.86, this is finally fixed. The cast now works."
"At the time of writing, this fix is in the beta channel, but stable release is just around the corner."
"Thank you so much to everyone who worked on this to make it work!"
The article discusses the As-Any Hack, a workaround for upcasting to supertraits in Rust which was necessary due to limitations in earlier versions. Specifically, it highlighted issues with calling methods from Any on a dyn DebugAny, which resulted in compile errors. However, with the release of Rust 1.86, this limitation has been addressed, allowing for successful downcasting references, enabling developers to retire older hacks. The author expresses gratitude to the contributors who made this development possible as the stable release approaches.
Read at Armin Ronacher's Thoughts and Writings
Unable to calculate read time
Collection
[
|
...
]