daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. trait MyFnMut: FnMut() {}
  2. impl<T: FnMut()> MyFnMut for T {}
  3.  
  4. trait MyFn: Fn() {}
  5. impl<T: Fn()> MyFn for T {}
  6.  
  7. fn constrain_mut<F: MyFnMut>(f: F) -> F { f }
  8. fn constrain<F: MyFn>(f: F) -> F { f }
  9.  
  10. fn main() {
  11.     constrain_mut(constrain(|| {}));
  12.     constrain(constrain_mut(|| {}));
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top