Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. use std::any::TypeId;
  2.  
  3. struct Type {
  4. type_id: TypeId
  5. }
  6.  
  7. struct Instance<'a> {
  8. t: &'a Type
  9. }
  10.  
  11. impl <'a> Instance<'a>{
  12. fn new(t: &Type) -> Instance<'a> {
  13. Instance { // <-- how do I specify the runtime 'a of Instance here????
  14. t
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement