rust-lang / rust-lang/polonius

Revisit the "Location::All" hack

Open
#24 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.7k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

As part of the nll-facts borrowck work, I added the idea of outlives relation that occur at all points. I did my best to explain it here:

https://github.com/rust-lang/rust/blob/0cd465087d800f6e1183ed3e8a71262039245902/src/librustc_mir/borrow_check/nll/type_check/mod.rs#L627-L657

I handled this by adding the relevant outlives relationships to all points. But, looking at the outlives.facts I saw that these relations account for a LOT of noise. Of the ~500K tuples in that file, about half are due to this. =) Moreover, these tuples will mess up any optimizations like #20. It's clear we need a better approach, but I'm not sure what.

That said, manually removing those tuples and re-running the analysis shows that they only have a small effect on overall performance (from ~40s to ~35s).

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 explanation in src/librustc_mir/borrow_check/nll/type_check/mod.rs at lines 627-657, then inspect the outlives.facts data described in the issue. Investigate an alternative to adding these outlives relationships at all points, with the goal of reducing tuple noise while preserving the analysis and considering the effect on optimizations such as #20.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Refactor
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.