-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
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.
Metadata
Metadata
Labels
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.