rust/tests
bors 341efb1017 Auto merge of #117560 - lqd:issue-117146, r=matthewjasper
Compute polonius loan scopes over the region graph

In issue #117146 a loan flows into an SCC containing a placeholder, and whose representative is an existential region. Since we currently compute loan scopes by looking at SCCs and their representatives only, polonius would compute kill points for this loan here whereas NLLs would not of course.

There are a few ways to fix this:
- don't try to be efficient by doing the computation over SCCs, and simply look for free regions and placeholders in the successors of the issuing region.
- change how the SCC representatives are picked, biasing towards placeholders over existential regions. They *shouldn't* matter much, but some downstream code may subtly depend on the current scheme (though no tests fail if we do such a change). This is for unrelated reasons also the way #116891 changes the representative computation. So that PR would also fix issue #117146.
- try to remove placeholders from the main path, and contain them to a pre-pass + a post-pass kind of polonius leak check. If possible, it would fix this issue by turning an outlives constraints to a placeholder into a constraint to 'static. This should also fix the issue, as the representative would be the free region in the SCC. We want to prototype this change to see if it's possible to try to simplify the borrowck main path from having to deal with placeholders and higher-ranked subtyping 🤞.

I'd like to take advantage of fuzzing and a crater run sooner rather than later, so that we grow more confidence that the 2 models are indeed equivalent empirically. Therefore this PR implements option 1 to fix the issue now.

We can take care of efficiency later after validation, and once we implement option 3 (which could also impact option 2 and that associated PR, maybe the lack of placeholders could remove the need to change the representative computation) to traverse SCCs and their representative again.

(Or we maybe will have some kind of naive position-dependent outlives propagation by then and this code would have been changed)

Fixes #117146.

r? `@matthewjasper`
2023-11-08 16:13:37 +00:00
..
assembly Fix closure-inherit-target-feature test for SGX platform 2023-10-23 14:39:01 +02:00
auxiliary
codegen Add -Zcross-crate-inline-threshold=yes 2023-11-07 18:45:11 -05:00
codegen-units Automatically enable cross-crate inlining for small functions 2023-10-17 19:53:51 -04:00
coverage coverage: Rename the run-coverage test mode to coverage-run 2023-11-08 16:41:24 +11:00
coverage-run-rustdoc coverage: Rename the run-coverage test mode to coverage-run 2023-11-08 16:41:24 +11:00
debuginfo Check alignment of pointers only when read/written through 2023-11-04 13:01:32 -04:00
incremental Bless incremental tests. 2023-10-06 15:46:11 +00:00
mir-opt Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillot 2023-11-05 13:44:59 +00:00
pretty Remove unnecessary CVarArgs name skipping logic 2023-10-25 17:44:17 +02:00
run-make Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
run-make-fulldeps Minimize pub usage in source_map.rs. 2023-11-02 19:35:00 +11:00
run-pass-valgrind
rustdoc Rollup merge of #117531 - fmease:rustdoc-effects-properly-elide-x-crate-host-args, r=GuillaumeGomez 2023-11-08 11:25:54 +01:00
rustdoc-gui Add GUI test to ensure that implementations on foreign types are in the expected order 2023-11-02 18:02:14 +01:00
rustdoc-js Add regression test for #115480 2023-10-11 11:41:39 +02:00
rustdoc-js-std
rustdoc-json Accept less invalid Rust in rustdoc 2023-10-31 13:58:03 +00:00
rustdoc-ui Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
ui Auto merge of #117560 - lqd:issue-117146, r=matthewjasper 2023-11-08 16:13:37 +00:00
ui-fulldeps add fn visit_capture_by to MutVisitor and fix pprust-expr-roundtrip.rs 2023-11-04 21:04:54 +01:00
COMPILER_TESTS.md