Reintroduce a FCW system to borrowck
| Metadata | |
|---|---|
| Point of contact | Oli Scherer |
| Status | Accepted |
| Funding contact | RustNL |
| Tracking issue | rust-lang/rust-project-goals#713 |
| Zulip channel | N/A |
| compiler champion | Oli Scherer |
| types champion | lcnr |
| Teams | compiler, types |
| Task owners | Oli Scherer |
Summary
When borrowck was transitioned to NLL, we had a system for turning some errors into warnings, if they only happened with NLL but not old borrowck and generally compare two impls of borrowck to make sure the errors match up.
Due to recent changes to borrowck (opaque type handling and borrowcking typeck children individually), the remains of the system for comparing two runs of borrowck can’t easily be used anymore for those purposes.
Motivation
The status quo
Fixing soundness bugs sometimes requires breaking changes. We want to carefully roll them out, so we would like to be able to run borrowck with the new system and if there were any errors, run it also with the old system and compare errors.
What we propose to do about it
I’m going to refactor the diagnostic reporting infra in borrowck and introduce a diagnostic comparison system.
Work items over the next year
| Task | Owner(s) | Notes |
|---|---|---|
link all Diag<'infcx> to the borrowck root instead | Oli Scherer | |
| delay all diag reporting to the end of borrowck | Oli Scherer | may change diagnostic order |
| add an enum for borrowck modes and a list of borrowck modes to try and compare errors between | Oli Scherer | we don’t have anything to test this well, so I may need to test it with some dummy change |
Team asks
Funding
| Purpose | Cost | Funded | Sponsor(s) |
|---|---|---|---|
| Reviews | Ask | Partial |