Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Handle let _ = x in coercing closures to FnPtr #23

@arora-aman

Description

@arora-aman

Consider the following closure:

let x;

let c = || {
    let _ = x;
};

let f: fn() = c; 

When capture_disjoint_fields is enabled, this closure doesn't capture x, implying c can be coerced to an FnPtr.

However, the code that checks if coercion can happen depends on upvars_mentioned which are computed before the capture analysis and would result in an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions