Skip to content

const_panic: ICE on non-&str panic payload #66693

Closed
@RalfJung

Description

@RalfJung

The panic payload of the std::panic! macro (as passed on to begin_panic) is generic, but the CTFE panic support assumes it will always be an &str. This leads to ICEs:

#![feature(const_panic)]

const C: () = {
    panic!(1234);
};

Cc @oli-obk

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)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.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions