Guest User

Untitled

a guest
Jan 17th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. fn foo() -> () {
  2. loop {
  3.  
  4. }
  5. }
  6.  
  7. fn bar() -> ! {
  8. loop {
  9.  
  10. }
  11. }
  12.  
  13.  
  14.  
  15. type Empty = *const fn() -> ();
  16.  
  17. fn main() {
  18. let mut x: Empty = foo as Empty;
  19. x = bar as Empty;
  20.  
  21. unsafe {
  22. (*x)();
  23. }
  24. }
Add Comment
Please, Sign In to add comment