SHARE
TWEET

Coderust

a guest Feb 18th, 2020 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::fmt::Debug;
  2.  
  3. #[derive(Debug)]
  4. struct TRef<'a, T: 'a> {
  5.     t_num: &'a T,
  6. }
  7.  
  8. struct NoDebug();
  9.  
  10. fn print_t_ref<'a, T>(t: &'a T)
  11. where
  12.    T: Debug + 'a,
  13. {
  14.     println!("this is a generic num: {:?}", t);
  15. }
  16.  
  17. fn main() {
  18.     let generic_ref = TRef { t_num: &32i32 };
  19.     print_t_ref(&k");
  20. }
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