compiler-errors/next-solver-hir-issues

ICE: Placeholder const in deep rejection

compiler-errors opened this issue · 0 comments

struct Wrapper<T, const N: usize>([T; N]);

trait Foo {}
fn needs_foo<F: Foo>() {}

impl<T> Foo for [T; 1] {}

fn test<T, const N: usize>() {
    needs_foo::<[T; N]>();
}
error: internal compiler error: compiler/rustc_middle/src/ty/fast_reject.rs:375:17: unexpected obl const: Const { ty: usize, kind: Placeholder(Placeholder { universe: U0, name: 0 }) }

We shouldn't ICE for placeholder consts here since we canonicalize parameters