Skip to content

Internal error when assigning a closure call to a reference #1472

@fpoli

Description

@fpoli

The program

fn main() {
    let mut a = 123;
    let x = &mut a;
    let gen = || { x };
    let y = gen(); // <-- ERROR
}

raises the internal error

Details: Type Closure(DefId(0:4 ~ 20231102_153740[9d5e]::main::{closure#0}), [i32, Binder(extern "RustCall" fn(()) -> &'?11 mut i32, []), (&'?12 mut i32,)]) can not be dereferenced

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions