Closed
Description
So, while writing some really nasty code for an interpreter, I ended up with an overcomplicated version of this code:
use std::sync::Arc;
pub enum ThingOrRef<S> where S: AsRef<Self> {
ThingRef(S),
Thing
}
pub type ThingArena<'ctx, T> = ThingOrRef<Arc<Self>>;
Alas, it leads to an ICE, with this message:
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 18446744073709551615'
I wonder how an unchecked overflow got in there (18446744073709551615 == -1)...
Funnily enough, if I remove the 'ctx
or the T
(or both) it compiles just fine, without error. But with both the ctx
and T
in, crash.