return &answer; ^~~~~~~ test.rs:1:22: 4:2 note: reference must be valid for the anonymous lifetime #1 defined on the block at 1:21... test.rs:1 fn compute() -> &int { test.rs:2 let answer: int = 42; test.rs:3 return &answer; test.rs:4 } test.rs:1:22: 4:2 note: ...but borrowed value is only valid for the block at 1:21 test.rs:1 fn compute() -> &int { test.rs:2 let answer: int = 42; test.rs:3 return &answer; test.rs:4 } error: aborting due to previous error
on the stack as much as possible. • Use owned pointer when you can decide the object’s lifetime. • Use borrowed pointer when you know the object’s lifetime. • Use reference counted ...
the time of writing, is written in Rust. • Servo: a prototype web parallel browser engine written in the Rust language. • Sprocketnes: NES emulator written in Rust as a technology demonstration. • Boot2Rust: EFI applications in Rust.