Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unused)]
- trait Trait {
- fn foo(&self);
- }
- struct Impl {}
- impl Trait for Impl {
- fn foo(&self) {
- println!("Hi");
- }
- }
- fn doo(t: Trait) {
- t.foo();
- }
- fn main() {
- let i = Impl{};
- doo(i as Trait);
- }
Add Comment
Please, Sign In to add comment