Guest User

Untitled

a guest
Aug 25th, 2019
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn foo<S: Into<String>>(s: S) {
  2. let s = s.into();
  3. let ptr: *const str = s.as_str();
  4. println!("after: {:?}", ptr);
  5. }
  6.  
  7. fn main() {
  8. let s = "test".to_string();
  9. let ptr: *const str = s.as_str();
  10. println!("after: {:?}", ptr);
  11. foo(s);
  12. }
RAW Paste Data