Skip to content

Commit 996e054

Browse files
committed
Auto merge of rust-lang#15288 - alibektas:15143, r=lnicola
Handle TyAlias in projected_ty First of all I still have no idea how MIR works but rust-lang#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 rust-lang#15143
2 parents 789dfd2 + f8f19c4 commit 996e054

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

crates/hir-ty/src/mir.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ impl<V, T> ProjectionElem<V, T> {
151151
TyKind::Adt(_, subst) => {
152152
db.field_types(f.parent)[f.local_id].clone().substitute(Interner, subst)
153153
}
154+
TyKind::Alias(inner) => inner.clone().intern(Interner),
154155
_ => {
155156
never!("Only adt has field");
156157
return TyKind::Error.intern(Interner);
@@ -167,6 +168,7 @@ impl<V, T> ProjectionElem<V, T> {
167168
TyKind::Error.intern(Interner)
168169
}),
169170
TyKind::Closure(id, subst) => closure_field(*id, subst, *f),
171+
TyKind::Alias(inner) => inner.clone().intern(Interner),
170172
_ => {
171173
never!("Only tuple or closure has tuple or closure field");
172174
return TyKind::Error.intern(Interner);

0 commit comments

Comments
 (0)