Skip to content

ICE with global variable promoting extern fn to @fn #7364

Closed
@bblum

Description

enum Foo {
    Call(@fn())
}

static f: Foo = Call(main);

fn main() { } 

This also ICEs if Foo is a struct, although it doesn't ICE if you change it to Option<@fn()>.

oops.rs:5:21: 5:25 error: internal compiler error: unexpected static function:
                         region re_static sigil ManagedSigil
oops.rs:5 static f: Foo = Call(main);
                               ^~~~

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions