Guest User

Untitled

a guest
Oct 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. trait MyTrait {
  2. }
  3.  
  4. struct data1 {
  5. a: String
  6. }
  7. impl MyTrait for data1 {}
  8.  
  9. struct data2 {
  10. a: u32
  11. }
  12. impl MyTrait for data2 {}
  13.  
  14. struct MyStruct {
  15. test: MyTrait
  16. }
  17.  
  18. fn main() {
  19. let a = MyStruct{test: &data2{a: 1}};
  20. }
Add Comment
Please, Sign In to add comment