rust-lang / rust-lang/rustc_public

Retrieve borrowck info(and lifetime info)

Open
#119 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
125
Forks
19
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Stable MIR context in this issue and issue #78, then inspect the rustc_driver consumer provider get_bodies_with_borrowck_facts. Determine how NLL, Polonius, and lifetime information could be represented through the Stable MIR interface; the issue currently has no named files, tests, or concrete acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.