rust/tests
Dylan DPC b41db841e8
Rollup merge of #112399 - compiler-errors:closure-substs-root-universe, r=lcnr
Instantiate closure synthetic substs in root universe

In the UI test example, we end up generalizing an associated type (something like `<Map<Option<i32>, [closure upvars=?0]> as IntoIterator>::Item` generalizes into `<Map<Option<i32>, [closure upvars=?1]> as IntoIterator>::Item`) then assigning it to itself, emitting an alias-relate goal. This trivially holds via one of the normalizes-to candidates, instead of relating substs, so when closure analysis eventually sets `?0` to the actual upvars, `?1` never gets constrained. This ends up being reported as an ambiguity error during writeback.

Instead, we can take advantage of the fact that we *know* the closure substs live in the root universe. This will prevent them being generalized, since they always can be named, and the alias-relate above never gets emitted at all.

We can probably do this to a handful of other `next_ty_var` calls in typeck for variables that are clearly associated with the body of the program, but I wanted to limit this for now. Eventually, if we end up representing universes more faithfully like a tree or whatever, we can remove this and turn it back to just a call to `next_ty_var`.

Note: This is incredibly order-dependent -- we need to be assigning a type variable that was created *before* the closure substs, and we also need to actually have an unnormalized type at the time of the assignment. This currently seems easiest to trigger during call argument analysis just due to the fact that we instantiate the call's substs, normalize, THEN check args.

r? ```@lcnr```
2023-06-16 14:46:14 +05:30
..
assembly Fix linkage for large binaries on mips64 platforms ... 2023-05-29 10:57:03 -06:00
auxiliary
codegen use indexed loop instead of ptr bumping 2023-06-14 22:22:41 +02:00
codegen-units
debuginfo
incremental Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
mir-opt Remove comments from mir-opt MIR dumps 2023-06-15 15:19:11 -04:00
pretty
run-make Auto merge of #112346 - saethlin:no-comment, r=oli-obk 2023-06-16 01:55:34 +00:00
run-make-fulldeps Auto merge of #111626 - pjhades:output, r=b-naber 2023-06-09 09:45:40 +00:00
run-pass-valgrind
rustdoc Rollup merge of #112304 - GuillaumeGomez:re-exports, r=notriddle 2023-06-15 17:52:36 +02:00
rustdoc-gui Rollup merge of #112613 - GuillaumeGomez:fix-gui-test-windows, r=notriddle 2023-06-14 18:10:32 +02:00
rustdoc-js Auto merge of #112233 - notriddle:notriddle/search-unify, r=GuillaumeGomez 2023-06-15 03:04:46 +00:00
rustdoc-js-std Auto merge of #112233 - notriddle:notriddle/search-unify, r=GuillaumeGomez 2023-06-15 03:04:46 +00:00
rustdoc-json Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard 2023-05-22 18:22:08 +01:00
rustdoc-ui rustdoc: get unnormalized link destination for suggestions 2023-05-26 18:38:46 -07:00
ui Rollup merge of #112399 - compiler-errors:closure-substs-root-universe, r=lcnr 2023-06-16 14:46:14 +05:30
ui-fulldeps Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
COMPILER_TESTS.md