Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Trait {
- type Associated;
- }
- struct Base;
- impl Trait for Base {
- type Associated = u32;
- }
- #[derive(Copy, Clone)]
- struct Foo<E: Trait> {
- s: E::Associated,
- }
- // just checks that T implement copy
- fn assert_copy<T:Copy>(t:T) {}
- fn main () {
- assert_copy(Foo::<Base>{s:12})
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement