Closed
Description
The following code:
#![feature(const_generics)]
struct NoMatch;
fn foo<const T: NoMatch>() -> bool {
return true
}
fn main() {
foo::<{NoMatch}>();
}
Produces an ICE:
error: internal compiler error: src/librustc/ty/relate.rs:598: non-Scalar ConstValue encountered in super_relate_consts Const { ty: NoMatch, val: ByRef { align: Align { pow2: 0 }, offset: Size { raw: 0 }, alloc: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, align: Align { pow2: 0 }, mutability: Immutable, extra: () } } } Const { ty: NoMatch, val: ByRef { align: Align { pow2: 0 }, offset: Size { raw: 0 }, alloc: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, align: Align { pow2: 0 }, mutability: Immutable, extra: () } } }
Metadata
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Category: This is a bug.`#![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.