Rust1.86才正式稳定trait的upcast,为什么在rust中这个特性实现如此复杂?

Views :
Update time : 2025-06-24 07:00:10

关注了这个问题好久,怎么一个回答都没有……那我抛砖引玉吧。

trait upcasting的tracking issue是这个: Tracking issue for dyn upcasting coercion · Issue #65991 · rust-lang/rust 之前看过一个知乎回答讲了实现: rust语言中怎么把子trait转成父trait? 过程本来这个特性都已经稳定了(将在1.76发布): ***s://github***/rust-lang/rust/pull/118133 然而出现了unsound问题: ***s://github***/rust-lang/rust/issues/120222 和 ***s://github***/rust-lang/rust/issues/120217 于是只好回退: …。

Rust1.86才正式稳定trait的upcast,为什么在rust中这个特性实现如此复杂?
Related News
Read More >>
Blog Post With Youtube Video 如何评价苹果 3 月 5 日发布的 MacBook Air M4,相比前代有哪些提升?
2025-06-20 23:35:11
如何评价苹果 3 月 5 日发布的 MacBook Air M4,相比前代有哪些提升?...
Blog Post With Youtube Video 为什么说英制单位是人类文明的一颗毒瘤?
2025-06-21 00:25:11
为什么说英制单位是人类文明的一颗毒瘤?...
Blog Post With Youtube Video 如何看待rust编写的zed编辑器?
2025-06-20 22:55:11
如何看待rust编写的zed编辑器?...
Blog Post With Youtube Video duckdb的性能如何?
2025-06-21 00:30:11
duckdb的性能如何?...

Leave Your Message