Medium
Reference-typed struct fields and lifetime elision
What happens when this code is compiled?
main.rs
struct Parser {
input: &str,
pos: usize,
}
fn main() {
let text = String::from("1 + 2");
let p = Parser { input: &text, pos: 0 };
println!("{}", p.input);
}6 of 53 in Rust