Description
The check_in_alloc
function currently takes a InboundsCheck
for error reporting purposes. That's suboptimal for two reasons: (a) passing InboundsCheck::Live/MaybeDead
sounds like it would affect the check that is performed, but it does not; and (b) the error still doesn't actually say what we tried to do with this pointer (access memory, in-bounds arithmetic, pointer equality test, ...).
The InboundsCheck
argument should be replaced by something else, and that something else should also be put into the PointerOutOfBounds
variant of EvalErrorKind
. That could either be an &'static str
or a more informative enum. I'd probably start with the string, since it seems unlikely we will want to use this for anything but displaying errors to the user, and it seems okay to not be able to use format!
.
Cc @oli-obk