I have a code here.
y is the owner for the reference of x.
But in Rust 2018, I could compile and run the code sucessfully without
de-referencing. Could someone explain ?.
fn main()
{
let x = 5;
let y = &x;
println!("{}", x);
println!("{}", y);
}
The implementation of Display for references just prints out the value that the reference points to. So printing either 5 or &5 will result in the same output.