rust/tests/ui/lazy-type-alias
bors d3df8ff851 Auto merge of #120780 - fmease:lta-in-impls, r=oli-obk
Properly deal with weak alias types as self types of impls

Fixes #114216.
Fixes #116100.

Not super happy about the two ad hoc “normalization” implementations for weak alias types:

1. In `inherent_impls`: The “peeling”, normalization to [“WHNF”][whnf]: Semantically that's exactly what we want (neither proper normalization nor shallow normalization would be correct here). Basically a weak alias type is “nominal” (well...^^) if the WHNF is nominal. [#97974](https://github.com/rust-lang/rust/pull/97974) followed the same approach.
2. In `constrained_generic_params`: Generic parameters are constrained by a weak alias type if the corresp. “normalized” type constrains them (where we only normalize *weak* alias types not arbitrary ones). Weak alias types are injective if the corresp. “normalized” type is injective.

Both have ad hoc overflow detection mechanisms.

**Coherence** is handled in #117164.

r? `@oli-obk` or types

[whnf]: https://en.wikipedia.org/wiki/Lambda_calculus_definition#Weak_head_normal_form
2024-02-18 03:58:56 +00:00
..
auxiliary Store the laziness of type aliases in the DefKind 2023-08-07 15:54:31 +02:00
coerce-behind-lazy.current.stderr Resolve target type of coercion 2023-08-07 19:06:18 +00:00
coerce-behind-lazy.next.stderr Resolve target type of coercion 2023-08-07 19:06:18 +00:00
coerce-behind-lazy.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
constrained-params.rs Properly check constrainedness of gen params in the presence of weak alias types 2024-02-17 08:39:01 +01:00
enum-variant.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
enum-variant.stderr Check lazy type aliases for well-formedness 2023-07-30 11:24:15 +02:00
extern-crate-has-eager-type-aliases.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-has-lazy-type-aliases.locally_eager.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
extern-crate-has-lazy-type-aliases.locally_lazy.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
extern-crate-has-lazy-type-aliases.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
implied-outlives-bounds.neg.stderr Imply outlives-bounds on lazy type aliases 2023-12-28 02:03:43 +01:00
implied-outlives-bounds.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
inherent-impls-conflicting.rs Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
inherent-impls-conflicting.stderr Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
inherent-impls-not-nominal.rs Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
inherent-impls-not-nominal.stderr Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
inherent-impls-overflow.classic.stderr Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
inherent-impls-overflow.next.stderr Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
inherent-impls-overflow.rs Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
inherent-impls.rs Support weak alias types as self type of inherent impls 2024-02-17 08:38:59 +01:00
leading-where-clause.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
leading-where-clause.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
leading-where-clause.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
trailing-where-clause.rs Unlock trailing where-clauses for lazy type aliases 2023-08-10 16:13:08 +02:00
trailing-where-clause.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-alias-bounds-are-enforced.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unconstrained-param-due-to-overflow.rs Properly check constrainedness of gen params in the presence of weak alias types 2024-02-17 08:39:01 +01:00
unconstrained-param-due-to-overflow.stderr Properly check constrainedness of gen params in the presence of weak alias types 2024-02-17 08:39:01 +01:00
unconstrained-params.rs Properly check constrainedness of gen params in the presence of weak alias types 2024-02-17 08:39:01 +01:00
unconstrained-params.stderr Properly check constrainedness of gen params in the presence of weak alias types 2024-02-17 08:39:01 +01:00
unsatisfied-bounds-type-alias-body.rs Check lazy type aliases for well-formedness 2023-07-30 11:24:15 +02:00
unsatisfied-bounds-type-alias-body.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unused-generic-parameters.rs Improve the diagnostics for unused generic parameters 2024-02-01 16:18:03 +01:00
unused-generic-parameters.stderr Improve the diagnostics for unused generic parameters 2024-02-01 16:18:03 +01:00
variance.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00