Skip to content

Retrieve borrowck info(and lifetime info) #119

Description

@zhuyutian57

During borrow checking, a significant amount of information is computed for static analysis (i.e., the borrow checking process itself). For example, the borrow checker computes the live range of a borrow, which is distinct from the lifetime of a reference variable. This information could be valuable for designing analyses based on Stable MIR. As seen in issue #78, some work requires access to lifetime parameters. Currently, Stable MIR includes neither lifetime information nor borrowck information.

Via rustc_driver, the borrowck provider get_bodies_with_borrowck_facts in consumer can be used to dump borrowck information along with the MIR body for each function. This provides access to computed information for both NLL and Polonius. However, Stable MIR currently has no way to access this information.

I believe it would be beneficial to preserve such information in Stable MIR. What are your thoughts? Are there any existing plans or discussions within the Stable MIR project group to expose borrowck facts (such as those from NLL and Polonius) through the Stable MIR interface?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions