rust/tests
bors 8327047b23 Auto merge of #113393 - compiler-errors:next-solver-unsize-rhs, r=lcnr
Normalize the RHS of an `Unsize` goal in the new solver

`Unsize` goals are... tricky. Not only do they structurally match on their self type, but they're also structural on their other type parameter. I'm pretty certain that it is both incomplete and also just plain undesirable to not consider normalizing the RHS of an unsize goal. More practically, I'd like for this code to work:

```rust
trait A {}
trait B: A {}

impl A for usize {}
impl B for usize {}

trait Mirror {
    type Assoc: ?Sized;
}

impl<T: ?Sized> Mirror for T {
    type Assoc = T;
}

fn main() {
    // usize: Unsize<dyn B>
    let x = Box::new(1usize) as Box<<dyn B as Mirror>::Assoc>;
    // dyn A: Unsize<dyn B>
    let y = x as Box<<dyn A as Mirror>::Assoc>;
}
```

---

In order to achieve this, we add `EvalCtxt::normalize_non_self_ty` (naming modulo bikeshedding), which *must* be used for all non-self type arguments that are structurally matched in candidate assembly. Currently this is only necessary for `Unsize`'s argument, but I could see future traits requiring this (hopefully rarely) in the future. It uses `repeat_while_none` to limit infinite looping, and normalizes the self type until it is no longer an alias.

Also, we need to fix feature gate detection for `trait_upcasting` and `unsized_tuple_coercion` when HIR typeck has unnormalized types. We can do that by checking the `ImplSource` returned by selection, which necessitates adding a new impl source for tuple upcasting.
2023-07-25 17:10:31 +00:00
..
assembly
auxiliary
codegen Auto merge of #111836 - calebzulawski:target-feature-closure, r=workingjubilee 2023-07-23 00:16:03 +00:00
codegen-units
debuginfo
incremental
mir-opt Auto merge of #114011 - RalfJung:place-projection, r=oli-obk 2023-07-25 14:18:08 +00:00
pretty
run-coverage
run-coverage-rustdoc
run-make Support .comment section like GCC/Clang (!llvm.ident) 2023-07-21 22:01:50 +02:00
run-make-fulldeps On nightly, dump ICE backtraces to disk 2023-07-19 14:10:07 +00:00
run-pass-valgrind
rustdoc Auto merge of #113958 - lukas-code:doc-links, r=GuillaumeGomez,petrochenkov 2023-07-25 01:35:53 +00:00
rustdoc-gui Migrate GUI colors test to original CSS color format 2023-07-23 13:05:40 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui validate doc(masked) 2023-07-24 18:04:35 +02:00
ui Auto merge of #113393 - compiler-errors:next-solver-unsize-rhs, r=lcnr 2023-07-25 17:10:31 +00:00
ui-fulldeps
COMPILER_TESTS.md