rust/tests/ui/higher-ranked
bors d163e5e515 Auto merge of #123737 - compiler-errors:alias-wf, r=lcnr
Check alias args for WF even if they have escaping bound vars

#### What

This PR stops skipping arguments of aliases if they have escaping bound vars, instead recursing into them and only discarding the resulting obligations referencing bounds vars.

#### An example:

From the test:
```
trait Trait {
    type Gat<U: ?Sized>;
}

fn test<T>(f: for<'a> fn(<&'a T as Trait>::Gat<&'a [str]>)) where for<'a> &'a T: Trait {}
//~^ ERROR the size for values of type `[()]` cannot be known at compilation time

fn main() {}
```

We now prove that `str: Sized` in order for `&'a [str]` to be well-formed. We were previously unconditionally skipping over `&'a [str]` as it referenced a buond variable. We now recurse into it and instead only discard the `[str]: 'a` obligation because of the escaping bound vars.

#### Why?

This is a change that improves consistency about proving well-formedness earlier in the pipeline, which is necessary for future work on where-bounds in binders and correctly handling higher-ranked implied bounds. I don't expect this to fix any unsoundness.

#### What doesn't it fix?

Specifically, this doesn't check projection predicates' components are well-formed, because there are too many regressions: https://github.com/rust-lang/rust/pull/123737#issuecomment-2052198478
2024-07-03 03:48:06 +00:00
..
leak-check drop region constraints for ambiguous goals 2024-05-24 20:32:35 +00:00
subtype [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
trait-bounds Add opaque type test 2024-06-20 09:20:45 +00:00
builtin-closure-like-bounds.rs Fix obligation param and bless tests 2024-04-01 22:48:23 -04:00
closure-bound-codegen-ice.rs Fix obligation param and bless tests 2024-04-01 22:48:23 -04:00
erroneous-lifetime-bound.rs Move binder and polarity parsing into parse_generic_ty_bound 2024-06-28 19:40:31 -04:00
erroneous-lifetime-bound.stderr Move binder and polarity parsing into parse_generic_ty_bound 2024-06-28 19:40:31 -04:00
higher-lifetime-bounds.rs Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
higher-lifetime-bounds.stderr Simple modification of diagnostic information 2023-12-21 10:17:11 +08:00
higher-ranked-lifetime-equality.rs Make nll higher ranked equate use bidirectional subtyping in invariant context 2024-02-29 15:27:59 -03:00
higher-ranked-lifetime-equality.stderr Make nll higher ranked equate use bidirectional subtyping in invariant context 2024-02-29 15:27:59 -03:00
higher-ranked-lifetime-error.rs eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
higher-ranked-lifetime-error.stderr eagerly instantiate binders to avoid relying on sub 2024-03-14 17:19:40 +01:00
structually-relate-aliases.rs Add test in higher-ranked 2024-03-23 23:33:43 +08:00
structually-relate-aliases.stderr rustc_type_ir: Omit some struct fields from Debug output 2024-06-19 03:08:34 +02:00
well-formed-aliases.rs Okay actually check only alias TYPES 2024-05-21 15:56:10 -04:00
well-formed-aliases.stderr Okay actually check only alias TYPES 2024-05-21 15:56:10 -04:00