I found that two kinds of Stacked Borrows errors are particularly common: creating
&mut that accidentally "kill" other pointers (might also happen with
& but seems to be less of an issue there), and casting a reference to a raw pointer that laters gets used to access things "next to" that reference (most common: using
&slice as *const _ instead of
slice.as_ptr()). I collected those here and here. If you know other cases of these, please let me know!
In particular I feel I have seen more of these "slice" issues... was that in questions by you @Jake Goulding ?
I don't recall there being multiple. Just this most recent one
that would be the "too much asserting of uniqueness" thing then, not "too weak raw ptrs"
I thought I had more cases of
as_ptr elsewhere... maybe I misremember.