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?
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
borrowckinformation.Via
rustc_driver, theborrowckproviderget_bodies_with_borrowck_factsinconsumercan be used to dumpborrowckinformation 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?