Skip to content

Commit

Permalink
Auto merge of #120780 - fmease:lta-in-impls, r=oli-obk
Browse files Browse the repository at this point in the history
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](rust-lang/rust#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
  • Loading branch information
bors committed Feb 18, 2024
2 parents e9b04cc + e63355a commit 3226074
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 3226074

Please sign in to comment.