rust/tests
nils 7e90732abe
Rollup merge of #109470 - compiler-errors:gat-normalize-bound, r=jackh726
Correctly substitute GAT's type used in `normalize_param_env` in `check_type_bounds`

Given:

```rust
trait Foo {
    type Assoc<T>: PartialEq<Self::Assoc<i32>>;
}

impl Foo for () {
    type Assoc<T> = Wrapper<T>;
}

struct Wrapper<T>(T);

impl<T> PartialEq<Wrapper<i32>> for Wrapper<T> { }
```

We add an additional predicate in the `normalize_param_env` in `check_type_bounds` that is used to normalize the GAT's bounds to check them in the impl. Problematically, though, that predicate is constructed to be `for<^0> <() as Foo>::Assoc<^0> => Wrapper<T>`, instead of `for<^0> <() as Foo>::Assoc<^0> => Wrapper<^0>`.

That means `Self::Assoc<i32>` in the bounds that we're checking normalizes to `Wrapper<T>`, instead of `Wrapper<i32>`, and so the bound `Self::Assoc<T>: PartialEq<Self::Assoc<i32>>` normalizes to `Wrapper<T>: PartialEq<Wrapper<T>>`, which does not hold.

Fixes this by properly substituting the RHS of that normalizes predicate that we add to the `normalize_param_env`. That means the bound is properly normalized to `Wrapper<T>: PartialEq<Wrapper<i32>>`, which *does* hold.

---

The second commit in this PR just cleans up some substs stuff and some naming.

r? `@jackh726` cc #87900
2023-03-28 12:51:13 +02:00
..
assembly Ignore LVI incompatible assembly tests on sgx platform 2023-03-10 16:04:37 +01:00
auxiliary Move /src/test to /tests 2023-01-11 09:32:08 +00:00
codegen Auto merge of #109474 - nikic:llvm-16-again, r=cuviper 2023-03-25 19:55:10 +00:00
codegen-units Use unused_generic_params from crate metadata 2023-03-14 16:33:12 +00:00
debuginfo Bless debuginfo test. 2023-03-13 18:24:48 +00:00
incremental Rollup merge of #105793 - lukas-code:circular-deps, r=Mark-Simulacrum 2023-03-19 15:33:55 +05:30
mir-opt Auto merge of #106428 - saethlin:inline-diverging-functions, r=cjgillot 2023-03-26 05:55:32 +00:00
pretty Auto merge of #108148 - parthopdas:master, r=oli-obk 2023-03-20 03:24:27 +00:00
run-make Fix LVI test post LLVM 16 update 2023-03-27 13:48:38 +02:00
run-make-fulldeps Rollup merge of #109213 - oli-obk:cstore, r=cjgillot 2023-03-22 22:44:40 +01:00
run-pass-valgrind Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustdoc Bless tidy 2023-03-27 18:58:07 +00:00
rustdoc-gui Rollup merge of #109633 - GuillaumeGomez:fix-go-to-only-setting, r=notriddle 2023-03-27 08:46:53 +02:00
rustdoc-js rustdoc: add support for type filters in arguments and generics 2023-03-20 22:41:57 -07:00
rustdoc-js-std rustdoc: add support for type filters in arguments and generics 2023-03-20 22:41:57 -07:00
rustdoc-json Add test for c_variadic in rustdoc-json 2023-03-18 17:59:29 +00:00
rustdoc-ui Rollup merge of #109330 - GuillaumeGomez:intermediate-reexport-intra-doc-ice, r=petrochenkov 2023-03-27 18:56:19 +02:00
ui Rollup merge of #109470 - compiler-errors:gat-normalize-bound, r=jackh726 2023-03-28 12:51:13 +02:00
ui-fulldeps rustc: Remove unused Session argument from some attribute functions 2023-03-22 13:55:55 +04:00
COMPILER_TESTS.md Move /src/test to /tests 2023-01-11 09:32:08 +00:00