Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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