rust/tests
bors 1f5768bc67 Auto merge of #96840 - cjgillot:query-feed, r=oli-obk
Allow to feed a value in another query's cache and remove `WithOptConstParam`

I used it to remove `WithOptConstParam` queries, as an example.

The idea is that a query (here `typeck(function)`) can write into another query's cache (here `type_of(anon const)`). The dependency node for `type_of` would depend on all the current dependencies of `typeck`.

There is still an issue with cycles: if `type_of(anon const)` is accessed before `typeck(function)`, we will still have the usual cycle.  The way around this issue is to `ensure` that `typeck(function)` is called before accessing `type_of(anon const)`.

When replayed, we may the following cases:
- `typeck` is green, in that case `type_of` is green too, and all is right;
- `type_of` is green, `typeck` may still be marked as red (it depends on strictly more things than `type_of`) -> we verify that the saved value and the re-computed value of `type_of` have the same hash;
- `type_of` is red, then `typeck` is red -> it's the caller responsibility to ensure `typeck` is recomputed *before* `type_of`.

As `anon consts` have their own `DefPathData`, it's not possible to have the def-id of the anon-const point to something outside the original function, but the general case may have to be resolved before using this device more broadly.

There is an open question about loading from the on-disk cache.  If `typeck` is loaded from the on-disk cache, the side-effect does not happen. The regular `type_of` implementation can go and fetch the correct value from the decoded `typeck` results, and the dep-graph will check that the hashes match, but I'm not sure we want to rely on this behaviour.

I specifically allowed to feed the value to `type_of` from inside a call to `type_of`.  In that case, the dep-graph will check that the fingerprints of both values match.

This implementation is still very sensitive to cycles, and requires that we call `typeck(function)` before `typeck(anon const)`.  The reason is that `typeck(anon const)` calls `type_of(anon const)`, which calls `typeck(function)`, which feeds `type_of(anon const)`, and needs to build the MIR so needs `typeck(anon const)`.  The latter call would not cycle, since `type_of(anon const)` has been set, but I'd rather not remove the cycle check.
2023-04-21 08:04:58 +00:00
..
assembly Add inline assembly support for m68k 2023-04-12 17:58:15 -07:00
auxiliary
codegen Auto merge of #109993 - scottmcm:transmute-niches, r=oli-obk 2023-04-20 10:46:13 +00:00
codegen-units Turn off inlining for codegen-unit tests 2023-04-07 15:46:45 -04:00
debuginfo ci: add a runner for vanilla LLVM 16 2023-04-16 11:50:20 -07:00
incremental Add incremental tests. 2023-04-20 18:01:15 +00:00
mir-opt Bless mir-opt. 2023-04-20 18:03:32 +00:00
pretty Auto merge of #108148 - parthopdas:master, r=oli-obk 2023-03-20 03:24:27 +00:00
run-make Bless coverage. 2023-04-20 21:36:22 +00:00
run-make-fulldeps Bless run-make-fulldeps test. 2023-04-20 18:03:33 +00:00
run-pass-valgrind
rustdoc Add regression test for #46506 2023-04-20 17:49:13 +02:00
rustdoc-gui Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgr 2023-04-12 22:19:29 +00:00
rustdoc-js rustdoc-search: add support for nested generics 2023-04-14 14:55:45 -07:00
rustdoc-js-std rustdoc-search: add support for nested generics 2023-04-14 14:55:45 -07:00
rustdoc-json Update tests for rustc_doc_primitive 2023-03-30 22:56:52 +02:00
rustdoc-ui Add a failing rustdoc-ui test for public infinite recursive type 2023-04-18 14:13:44 +02:00
ui Auto merge of #96840 - cjgillot:query-feed, r=oli-obk 2023-04-21 08:04:58 +00:00
ui-fulldeps Add Call terminator to SMIR 2023-04-20 12:00:41 -03:00
COMPILER_TESTS.md