Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE: "non-Scalar ConstValue encountered in super_relate_consts" with const generics #62579

Closed
Aaron1011 opened this issue Jul 11, 2019 · 0 comments · Fixed by #65696
Closed
Assignees
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Aaron1011
Copy link
Member

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: () } } }
@jonas-schievink jonas-schievink added A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 11, 2019
@Centril Centril added requires-nightly This issue requires a nightly compiler in some way. F-const_generics `#![feature(const_generics)]` labels Aug 6, 2019
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Oct 15, 2019
@varkor varkor self-assigned this Oct 23, 2019
varkor added a commit to varkor/rust that referenced this issue Oct 23, 2019
@bors bors closed this as completed in b2b3579 Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. F-const_generics `#![feature(const_generics)]` glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants