Skip to content

ICE when calling static and static mut function pointers. #8588

@brendanzab

Description

@brendanzab
fn f(x: int) -> int { x }

static mut F: extern fn(x: int) -> int = f;

fn main() {
    unsafe { F(1) }
}
error: internal compiler error: Cannot translate def def_static({crate: 0, node: 23}, true) to a callable thing!

Seems to have been resolved a while ago (#4523), but is still occurring. @Aatch has said this should be an easy fix, it just needs to be done. This is important for the OpengGL function loader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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