rust/tests
Dylan DPC c78e3c735a
Rollup merge of #107411 - cjgillot:dataflow-discriminant, r=oli-obk
Handle discriminant in DataflowConstProp

cc ``@jachris``
r? ``@JakobDegen``

This PR attempts to extend the DataflowConstProp pass to handle propagation of discriminants. We handle this by adding 2 new variants to `TrackElem`: `TrackElem::Variant` for enum variants and `TrackElem::Discriminant` for the enum discriminant pseudo-place.

The difficulty is that the enum discriminant and enum variants may alias each another. This is the issue of the `Option<NonZeroUsize>` test, which is the equivalent of https://github.com/rust-lang/unsafe-code-guidelines/issues/84 with a direct write.

To handle that, we generalize the flood process to flood all the potentially aliasing places. In particular:
- any write to `(PLACE as Variant)`, either direct or through a projection, floods `(PLACE as OtherVariant)` for all other variants and `discriminant(PLACE)`;
- `SetDiscriminant(PLACE)` floods `(PLACE as Variant)` for each variant.

This implies that flooding is not hierarchical any more, and that an assignment to a non-tracked place may need to flood a tracked place. This is handled by `for_each_aliasing_place` which generalizes `preorder_invoke`.

As we deaggregate enums by putting `SetDiscriminant` last, this allows to propagate the value of the discriminant.

This refactor will allow to make https://github.com/rust-lang/rust/pull/107009 able to handle discriminants too.
2023-02-15 12:24:55 +05:30
..
assembly Update the minimum external LLVM to 14 2023-02-10 16:06:25 -08:00
auxiliary
codegen Rollup merge of #107573 - cuviper:drop-llvm-13, r=nagisa 2023-02-14 18:24:40 +01:00
codegen-units
debuginfo Upgrade mingw-w64 on CI 2023-01-29 13:01:06 +01:00
incremental
mir-opt Rollup merge of #107411 - cjgillot:dataflow-discriminant, r=oli-obk 2023-02-15 12:24:55 +05:30
pretty Update tests. 2023-01-29 20:19:26 +01:00
run-make Auto merge of #105601 - BelovDV:change-rlib-with-not-stable, r=petrochenkov 2023-02-12 07:15:27 +00:00
run-make-fulldeps Modify primary span label for E0308 2023-01-30 20:12:19 +00:00
run-pass-valgrind
rustdoc rustdoc: add more tooltips to intra-doc links 2023-02-13 22:57:28 -07:00
rustdoc-gui Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, r=GuillaumeGomez 2023-02-13 11:34:56 +01:00
rustdoc-js rustdoc: update test cases to match with stricter match criteria 2023-01-21 00:11:39 -07:00
rustdoc-js-std rustdoc: add test case based on #103357 2023-01-24 09:49:33 -07:00
rustdoc-json
rustdoc-ui Rollup merge of #107838 - estebank:terminal_hyperlinks, r=nagisa 2023-02-13 11:34:57 +01:00
ui Rollup merge of #107173 - clubby789:suggest-array-length, r=compiler-errors 2023-02-15 12:24:54 +05:30
ui-fulldeps Forbid #[suggestion_*(...)] on Vecs 2023-02-01 21:49:45 +01:00
COMPILER_TESTS.md