Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Foo;
- trait Bar {
- fn baz(&self);
- }
- impl Bar for Foo {
- fn baz(&self) {
- println!("hi");
- }
- }
- fn main() {
- let x: Box<Bar> = Box::new(Foo);
- let y: Box<Foo> = Box::new(Foo);
- println!("{:p} {:p}", x, y);
- }
Add Comment
Please, Sign In to add comment