Skip to content

Instantly share code, notes, and snippets.

Created September 20, 2015 20:15
Show Gist options
  • Save anonymous/4c85bcab2cf9f8c56dc2 to your computer and use it in GitHub Desktop.
Save anonymous/4c85bcab2cf9f8c56dc2 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
trait TR {
type Assoc : Clone + Copy + Default;
}
#[derive(Clone, Copy, Default)]
struct Foo<T: TR> {
thing : T::Assoc,
}
impl <T: TR> Foo<T> {
fn bar() {
// This works
let _ : T::Assoc = Default::default();
// This does not.
let _ : Foo<T> = Default::default();
}
}
fn main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment