diff options
| author | Ali Bektas <bektasali@protonmail.com> | 2023-07-15 18:32:21 +0200 |
|---|---|---|
| committer | Ali Bektas <bektasali@protonmail.com> | 2023-07-15 18:32:21 +0200 |
| commit | 75f06ce1fb63898d45b301a796f83fa2e91f9871 (patch) | |
| tree | 85e5372a7efaa1293af5f60fdca9e7683d29ddbc | |
| parent | 789dfd2a256e2725d2bcf50cca3e73f0397b91f8 (diff) | |
| download | rust-75f06ce1fb63898d45b301a796f83fa2e91f9871.tar.gz rust-75f06ce1fb63898d45b301a796f83fa2e91f9871.zip | |
Handle TyAlias in projected_ty
| -rw-r--r-- | crates/hir-ty/src/mir.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/hir-ty/src/mir.rs b/crates/hir-ty/src/mir.rs index dc846fc3947..b598e5ebcf6 100644 --- a/crates/hir-ty/src/mir.rs +++ b/crates/hir-ty/src/mir.rs @@ -151,6 +151,7 @@ impl<V, T> ProjectionElem<V, T> { TyKind::Adt(_, subst) => { db.field_types(f.parent)[f.local_id].clone().substitute(Interner, subst) } + TyKind::Alias(al) => al.clone().intern(Interner), _ => { never!("Only adt has field"); return TyKind::Error.intern(Interner); @@ -167,6 +168,7 @@ impl<V, T> ProjectionElem<V, T> { TyKind::Error.intern(Interner) }), TyKind::Closure(id, subst) => closure_field(*id, subst, *f), + TyKind::Alias(al) => al.clone().intern(Interner), _ => { never!("Only tuple or closure has tuple or closure field"); return TyKind::Error.intern(Interner); |
