Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. // compile-pass
  2.  
  3. trait Tr1: Sized { type As1; }
  4. trait Tr2<'a>: Sized { type As1; }
  5.  
  6. trait ObjTr1 { fn foo() -> Self where Self: Tr1<As1: Copy>; }
  7. fn _assert_obj_safe_1(_: Box<dyn ObjTr1>) {}
  8.  
  9. trait ObjTr2 { fn foo() -> Self where Self: Tr1<As1: 'static>; }
  10. fn _assert_obj_safe_2(_: Box<dyn ObjTr2>) {}
  11.  
  12. trait ObjTr3 { fn foo() -> Self where Self: Tr1<As1: Into<u8> + 'static + Copy>; }
  13. fn _assert_obj_safe_3(_: Box<dyn ObjTr3>) {}
  14.  
  15. trait ObjTr4 { fn foo() -> Self where Self: Tr1<As1: for<'a> Tr2<'a>>; }
  16. fn _assert_obj_safe_4(_: Box<dyn ObjTr4>) {}
  17.  
  18. trait ObjTr5 { fn foo() -> Self where for<'a> Self: Tr1<As1: Tr2<'a>>; }
  19. fn _assert_obj_safe_5(_: Box<dyn ObjTr5>) {}
  20.  
  21. trait ObjTr6 { fn foo() -> Self where Self: for<'a> Tr1<As1: Tr2<'a, As2: for<'b> Tr2<'b>>>; }
  22. fn _assert_obj_safe_6(_: Box<dyn ObjTr6>) {}
  23.  
  24. fn main() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement