rust/tests
bors 32e7a4b92b Auto merge of #144405 - lcnr:hir-typeck-uniquify, r=BoxyUwU
uniquify root goals during HIR typeck

We need to rely on region identity to deal with hangs such as https://github.com/rust-lang/trait-system-refactor-initiative/issues/210 and to keep the current behavior of `fn try_merge_responses`.

This is a problem as borrowck starts by replacing each *occurrence* of a region with a unique inference variable. This frequently splits a single region during HIR typeck into multiple distinct regions. As we assume goals to always succeed during borrowck, relying on two occurances of a region being identical during HIR typeck causes ICE. See the now fixed examples in https://github.com/rust-lang/trait-system-refactor-initiative/issues/27 and rust-lang/rust#139409.

We've previously tried to avoid this issue by always *uniquifying* regions when canonicalizing goals. This prevents caching subtrees during canonicalization which resulted in hangs for very large types. People rely on such types in practice, which caused us to revert our attempt to reinstate `#[type_length_limit]` in https://github.com/rust-lang/rust/pull/127670. The complete list of changes here:
- rust-lang/rust#107981
- rust-lang/rust#110180
- rust-lang/rust#114117
- rust-lang/rust#130821

After more consideration, all occurrences of such large types need to happen outside of typeck/borrowck. We know this as we already walk over all types in the MIR body when replacing their regions with nll vars.

This PR therefore enables us to rely on region identity inside of the trait solver by exclusively **uniquifying root goals during HIR typeck**. These are the only goals we assume to hold during borrowck. This is insufficient as type inference variables may "hide" regions we later uniquify. Because of this, we now stash proven goals which depend on inference variables in HIR typeck and reprove them after writeback. This closes https://github.com/rust-lang/trait-system-refactor-initiative/issues/127.

This was originally part of rust-lang/rust#144258 but I've moved it into a separate PR. While I believe we need to rely on region identity to fix the performance issues in some way, I don't know whether rust-lang/rust#144258 is the best approach to actually do so. Regardless of how we deal with the hangs however, this change is necessary and desirable regardless.

r? `@compiler-errors` or `@BoxyUwU`
2025-07-31 00:32:55 +00:00
..
assembly-llvm Relax check lines in x86-return-float.rs 2025-07-29 14:08:19 +02:00
auxiliary So many test updates x_x 2025-07-20 10:15:14 -07:00
codegen-llvm Rollup merge of #144042 - dpaoliello:verifyllvmcomp, r=jieyouxu 2025-07-30 17:59:37 +10:00
codegen-units Auto merge of #142893 - Mark-Simulacrum:no-const-collect, r=oli-obk 2025-06-27 12:57:05 +00:00
coverage coverage: Treat #[automatically_derived] as #[coverage(off)] 2025-07-29 19:56:31 +10:00
coverage-run-rustdoc
crashes Auto merge of #144405 - lcnr:hir-typeck-uniquify, r=BoxyUwU 2025-07-31 00:32:55 +00:00
debuginfo Verify llvm-needs-components are not empty and match the --target value 2025-07-29 11:20:23 -07:00
incremental Bless incremental tests. 2025-07-13 13:50:01 +00:00
mir-opt Simplify align_of_val::<[T]>(…)align_of::<T>() 2025-07-28 23:19:06 -07:00
pretty expand: Micro-optimize prelude injection 2025-07-28 17:35:09 +03:00
run-make Rollup merge of #144668 - daltenty:daltenty/runmake-llvm-components, r=jieyouxu 2025-07-30 17:59:40 +10:00
rustdoc Test renamed crates in rustdoc 2025-07-28 13:34:03 +01:00
rustdoc-gui Update rustdoc GUI tests 2025-07-01 15:49:45 +02:00
rustdoc-js Add test for aliases partial match 2025-07-16 14:27:22 +02:00
rustdoc-js-std Add test for aliases partial match 2025-07-16 14:27:22 +02:00
rustdoc-json rustdoc-json: Structured attributes 2025-07-15 16:52:41 +00:00
rustdoc-ui Rollup merge of #144308 - GuillaumeGomez:merged-doctest-times, r=lolbinarycat 2025-07-30 19:49:02 +02:00
ui Auto merge of #144405 - lcnr:hir-typeck-uniquify, r=BoxyUwU 2025-07-31 00:32:55 +00:00
ui-fulldeps use RustcPublic instead of StableMir 2025-07-18 18:49:32 +00:00
COMPILER_TESTS.md