Closed
Description
#![feature(const_generics, const_evaluatable_checked)]
fn q<T, const N: usize>(_: T) -> [u8; N + 1] {
todo!()
}
fn supplier<T>() -> T {
todo!()
}
fn catch_me<const N: usize>() where [u8; N + 1]: Default {
let mut x = supplier();
x = q(x);
}
causes
thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `playground`
(it does ICE with incremental enabled, this is a different bug and tracked separately)
We end up referencing an inference variable in the value of said inference variable, causing an infinite type.
This should ordinarily be prevented by the occurs check. We either have a bug there or there is something else I have missed