Closed
Description
http://doc.rust-lang.org/guide-lifetimes.html#returning-references
struct Point {x: f64, y: f64}
fn get_x_sh(p: &Point) -> &f64 {
&p.x // Error reported here
}
Thanks to lifetime elision this example now compiles successfully.
Metadata
Metadata
Assignees
Labels
No labels