Why is it legal to borrow a temporary?
Why is it legal to borrow a temporary? It’s legal for the same reason it’s illegal in C++ — because someone said that’s how it should be. How long does the temporary live in Rust? And since x is only a borrow, who is the owner of the string? The reference says: the temporary scope … Read more