daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::fmt::Debug;
  2.  
  3. fn take_trait_obj<T: AsRef<Debug>>(o: T) {
  4.     println!("{:?}", o.as_ref());
  5. }
  6.  
  7. fn main(){
  8.     take_trait_obj::<Box<Debug>>(Box::new(1i32));
  9.     take_trait_obj(Box::new(1i32));
  10. }
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