Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. pub trait Bar<T: core::fmt::Debug> {
  2. fn meth(&mut self, x: Baz<T>);
  3. }
  4.  
  5. #[derive(Debug)]
  6. struct Baz<T> {
  7. x: T,
  8. }
  9.  
  10. #[derive(Debug)]
  11. #[allow(dead_code)]
  12. struct Foo {}
  13.  
  14. impl<T: core::fmt::Debug> Bar<T> for Foo {
  15. fn meth(&mut self, x: Baz<T>) {
  16. dbg!(self);
  17. dbg!(x);
  18. }
  19. }
  20.  
  21. fn main() {
  22. dbg!();
  23. println!("hello");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement