You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
traitTR{typeAssoc:Clone + Copy + Default;}#[derive(Clone,Copy,Default)]structFoo<T:TR>{thing:T::Assoc,}impl<T:TR>Foo<T>{fnbar(){// This workslet _ :T::Assoc = Default::default();// This does not.let _ :Foo<T> = Default::default();}}
This fails with "error: the trait core::default::Default is not implemented for the type T [E0277]". Except that we don't want a default T, we want a default Node.
Manually implementing Default works as a workaround:
#[derive(Default)]
fails on objects that contain a field of an associated type, even if that field is Default.For example (also https://gist.github.com/4c85bcab2cf9f8c56dc2):
This fails with "error: the trait
core::default::Default
is not implemented for the typeT
[E0277]". Except that we don't want a default T, we want a default Node.Manually implementing Default works as a workaround:
Happens in 1.3, beta, and nightly as of Sep. 20.
The text was updated successfully, but these errors were encountered: