在this issue page for Rust,它給出了core::num::bignum::FullOps
以下示例代碼:如何添加尺寸超級特徵到鏽性狀?
pub trait FullOps {
...
fn full_mul(self, other: Self, carry: Self) -> (Self /*carry*/, Self);
...
}
然後,它說:
這裏
full_mul
返回(Self, Self)
元組中的功能,這是隻有 合式當Self
-type爲Sized
- 由於那個和其他原因, 當Self
是Sized
時,這個特徵纔有意義。在這個案例和大多數其他案例中的解決方案是添加缺失的Sized
超小型。
如何添加缺少的Sized
supertrait?