Skip to content

ICE when compiling const fn that calls a non-const function through a pointer #56164

Closed
@eira-fransham

Description

@eira-fransham

My minimal reproduction:

#![feature(const_fn)]

const fn bad(input: fn()) {
    input()
}

fn main() {
    bad(|| {});
}

Sidenote: I'm pretty sure this is the smallest working ICE that I've seen in Rust so far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions