Rust oddness: integer literal references?
blog.gaborkozar.me
blog.gaborkozar.me
let x = &5;
// x is still valid here because the 5 is no longer a temporary but lives for the rest of the block
As well as constant promotion, not discussed in the post but similar! https://doc.rust-lang.org/stable/reference/destructors.html?... let x: &'static i32 = &5;
(this was originally called "rvalue static promotion" but Rust has since moved away from the rvalue/lvalue terminology since that time)