Skip to content

Prevent calling stack closures through immutable & pointers. #7836

Closed
@bblum

Description

@bblum

This is the last hole left over in the "case of the recurring closure" problem which was mostly but not quite fixed by #7363.

This program should be illegal (it isn't itself soundness-breaking, but isn't far from it):

fn bar(x: & &fn(), y: & &fn()) { (*x)(); (*y)(); }
fn foo(x: &fn()) { bar(&x, &x) }
fn main() {
        do foo || {}
}

Nominating backwards-compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsA-type-systemArea: Type systemI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions