Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait A {
- fn hello(&self) { println!("hello"); }
- }
- struct B<C: A> {
- pub c: Vec<C>
- }
- struct D;
- struct E(usize);
- impl A for D {}
- fn main() {
- let x = B{c: vec![D, E(42)]};
- x.c[0].hello();
- x.c[1].hello();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement