Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #![feature(impl_trait_in_bindings)]
  2. #![feature(maybe_uninit)]
  3.  
  4. pub trait Behaviour {}
  5.  
  6. pub struct System;
  7. impl Behaviour for System {}
  8.  
  9. fn mk_system() -> impl Behaviour {
  10. System
  11. }
  12.  
  13. static mut S: impl Behaviour = core::mem::uninitialized();
  14.  
  15. fn main() {
  16. let concrete_system = mk_system();
  17. core::ptr::write(&mut S, concrete_system);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement