Rollup merge of #109410 - fmease:iat-alias-kind-inherent, r=compiler-errors

Introduce `AliasKind::Inherent` for inherent associated types

Allows us to check (possibly generic) inherent associated types for well-formedness.
Type inference now also works properly.

Follow-up to #105961. Supersedes #108430.
Fixes #106722.
Fixes #108957.
Fixes #109768.
Fixes #109789.
Fixes #109790.

~Not to be merged before #108860 (`AliasKind::Weak`).~

CC `@jackh726`
r? `@compiler-errors`

`@rustbot` label T-types F-inherent_associated_types
This commit is contained in:
Michael Goulet
2023-05-08 09:30:21 -07:00
committed by GitHub
96 changed files with 1365 additions and 229 deletions

View File

@@ -1004,7 +1004,7 @@ impl<'tcx> Term<'tcx> {
match self.unpack() {
TermKind::Ty(ty) => match ty.kind() {
ty::Alias(kind, alias_ty) => match kind {
AliasKind::Projection => Some(*alias_ty),
AliasKind::Projection | AliasKind::Inherent => Some(*alias_ty),
AliasKind::Opaque => None,
},
_ => None,