- Published on
Article · Through the layers
Where a Rust String Literal Actually Lives
When you write let s: &str = "hello world", there are really two things in one line, living in two different places. Here is what each one is, where it lives, and why that explains lifetimes.