Hacker News new | ask | show | jobs
by dbaupp 4838 days ago
pcwalton is the voice of authority here, but to add to that, the following (verbose) example compiles and works as expected:

  fn make_string() -> ~str {
      return ~"foo";
  }

  fn main() {
     let string: ~str = make_string();

     io::println(string);
  } // deallocated here
1 comments

My bad folks :)