当我们需要一个依赖于特征中其他类型的类型时,我们如何克服关联类型默认值的问题?
trait Foo{
type C;
type K = Vec<Self::C>;
}
Run Code Online (Sandbox Code Playgroud)
error[E0658]: associated type defaults are unstable
|
3 | type K = Vec<Self::C>;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #29661 <https://github.com/rust-lang/rust/issues/29661> for more information
Run Code Online (Sandbox Code Playgroud)