Skip to content

Nightly compiler fails with ICE if const parameter is used to define type of function input #60632

Closed
@newpavlov

Description

@newpavlov

Code:

fn foo<const N: usize>(val: &[u8; N]) { }

Error:

error: internal compiler error: array length could not be evaluated

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:356:17

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions