- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-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.
Description
After #60742 is merged, the following produces:
#![feature(const_generics)]
use std::fmt;
struct Array<T, const N: usize>([T; N]);
impl<T: fmt::Debug, const N: usize> fmt::Debug for Array<T, {N}> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.debug_list().entries(self.0.iter()).finish()
    }
}
fn main() {
    println!("{:?}", Array([1, 2, 3]));
}results in:
error: internal compiler error: src/librustc/traits/codegen/mod.rs:160: Uninferred types/regions in `VtableImplData(impl_def_id=DefId(0:19 ~ bug[317d]::{{impl}}[0]), substs=[i32, Const { ty: usize, val: Infer(Var(_#0c)) }], nested=[(), ()])`
(Before #60742, this resulted in a different ICE.)
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-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.