Const generics ICE: trying to create const name for unexpected const #61747
Closed
Description
This code (playground):
#![feature(const_generics)]
struct Const<const N: usize>;
impl<const C: usize> Const<{C}> {
fn successor() -> Const<{C + 1}> {
Const
}
}
fn main() {
Const::<1>::successor();
}
results in an ICE:
error: internal compiler error: src/librustc/ty/print/obsolete.rs:201: DefPathBasedNames: trying to create const name for unexpected const: Const { ty: usize, val: Unevaluated(DefId(0:19 ~ playground[e6be]::{{impl}}[0]::successor[0]::{{constant}}[0]), []) }
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:637:9
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#![feature(const_generics)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.