`slice::from_raw_parts` returns a different address in const context

Hmm, it looks like this is a particular optimization that the compiler uses to treat &str and &[u8] as immediate values.

So the &[u8] is treated as a by-value empty slice, which gets converted into a pointer into (presumably) the area where all the strings end up.

3 Likes