My guess is that this is a bad idea, possibly because an unsized type does not allocate some bytes to store the length of the slice? Or, do unsized locals implicitly contains their length somewhere within?
Unsized local is a unstable feature so it's hard to say its semantics now. But I'm sure even with this feature, Rust never heap-allocate implicitly. Maybe it has its length somewhere in the stack?
Did you play around with a range (e.g., -2, -1, 0, 1, 2) relative to the pointer's offset? Perhaps the stack frame is multiple bytes, and is thus likely in LittleEndian form?
I used a [usize] and went 2 (maybe 3) before and after the slice but never got the length.
I also looked into the Mir output and all it says is it's making a reference.
And the assembly (I can't read assembly) but I tried to compare the output between a slice and a slice pointer but the output is identical. That's so weird.
We have int2 - int1 == 24 bytes, 8 bytes for int1 and 16 for a fat pointer. I tried different number of elements in the slice: no change.
And this display exactly want we'd expect: