Skip to content

Commit

Permalink
Auto merge of #15288 - alibektas:15143, r=lnicola
Browse files Browse the repository at this point in the history
Handle TyAlias in projected_ty

First of all I still have no idea how MIR works but #15143 has been an issue that constantly made RA crash so I have been looking for a way to make RA stop panicking. I have zero claims that what I want to merge has any sense or is correct 😄  but there isn't any more panicking. Even if it is wrong may this be at least a step towards resolving this issue.
As is customary this PR fixes #15143
  • Loading branch information
bors committed Jul 15, 2023
2 parents 789dfd2 + f8f19c4 commit 996e054
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/hir-ty/src/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(inner) => inner.clone().intern(Interner),
_ => {
never!("Only adt has field");
return TyKind::Error.intern(Interner);
Expand All @@ -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(inner) => inner.clone().intern(Interner),
_ => {
never!("Only tuple or closure has tuple or closure field");
return TyKind::Error.intern(Interner);
Expand Down

0 comments on commit 996e054

Please sign in to comment.