rust/compiler/rustc_borrowck/src/diagnostics
Matthias Krüger e38f1152be
Rollup merge of #136299 - lqd:polonius-next-episode-9, r=jackh726
Ignore NLL boring locals in polonius diagnostics

Another easy one ``@jackh726`` (the diff is inflated by blessed test expectations don't worry :)

NLLs don't compute liveness for boring locals, and therefore cannot find them in causes explaining borrows. In polonius, we don't have this liveness optimization (we may be able to do something partially similar in the future, e.g. for function parameters and the like), so we do encounter these in diagnostics even though we don't want to. This PR:
- restructures the polonius context into per-phase data, in spirit as you requested in an earlier review
- stores the locals NLLs would consider boring into the errors/diagnostics data
- ignores these if a boring local is found when trying to explain borrows

This PR fixes around 80 cases of diagnostics differences between `-Zpolonius=next` and NLLs. I've also added explicit revisions to a few polonius tests (both for the in-tree implementation as well as the datalog implementation -- even if we'll eventually remove them). I didn't do this for all the "dead" expectations that were removed from #136112 for that same reason, it's fine. I'll soon/eventually add explicit revisions where they're needed: there's only a handful of tests left to fix.

r? ``@jackh726``
2025-02-03 21:11:34 +01:00
..
bound_region_errors.rs Pass spans to perform_locally_in_new_solver 2025-01-25 20:53:34 +00:00
conflict_errors.rs Rollup merge of #136328 - estebank:long-ty-path, r=jieyouxu,lqd 2025-02-02 12:31:56 +01:00
explain_borrow.rs Rollup merge of #136299 - lqd:polonius-next-episode-9, r=jackh726 2025-02-03 21:11:34 +01:00
find_all_local_uses.rs Invert diagnostic lints. 2024-02-06 13:12:33 +11:00
find_use.rs Use Rc less in MirBorrowckCtxt. 2024-10-04 16:46:20 +10:00
mod.rs Rollup merge of #136368 - estebank:listify, r=fee1-dead 2025-02-02 12:31:57 +01:00
move_errors.rs Rework "long type names" printing logic 2025-01-31 20:39:01 +00:00
mutability_errors.rs Implement MIR, CTFE, and codegen for unsafe binders 2025-01-31 17:19:53 +00:00
opaque_suggestions.rs Fix typos 2024-12-27 21:35:57 +08:00
outlives_suggestion.rs Remove unnecessary lifetimes in dataflow structs. 2024-09-09 16:14:18 +10:00
region_errors.rs visit_x_unambig 2025-01-23 06:01:36 +00:00
region_name.rs Split hir TyKind and ConstArgKind in two and update hir::Visitor 2025-01-23 06:01:36 +00:00
var_name.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00