SHARE
TWEET

Untitled

a guest Aug 25th, 2019 66 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
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