/src/test/run-pass/child-outlives-parent.rs

http://github.com/jruderman/rust · Rust · 8 lines · 4 code · 3 blank · 1 comment · 0 complexity · c65ca3ec6263fe6c67be0aa1a663d9ac MD5 · raw file

  1. // Reported as issue #126, child leaks the string.
  2. use std;
  3. import task;
  4. fn child2(&&s: ~str) { }
  5. fn main() { let x = task::spawn(|| child2(~"hi") ); }