What is the ownership of string literals

String literals are owned by the program, stored in read-only memory, and have a static lifetime.

String literals in Rust are owned by the program itself and live for the entire duration of execution. They are stored in the binary's read-only data section and have a lifetime of 'static, meaning they never need to be dropped or managed by the runtime.

fn main() {
    let s: &'static str = "hello world";
    // The string "hello world" is owned by the program, not the variable `s`.
    // `s` is just a reference to that static memory.
}