Skip to content

Commit f10f7ae

Browse files
committed
Remove ProjectionElem::OpaqueCast
1 parent bde303a commit f10f7ae

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

crates/hir-ty/src/mir.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ pub enum ProjectionElem<V: PartialEq> {
181181
},
182182
/// "Downcast" to a variant of an enum or a coroutine.
183183
Downcast(VariantId),
184-
OpaqueCast(std::convert::Infallible), // TODO remove this
185184
}
186185

187186
impl<V: PartialEq> ProjectionElem<V> {
@@ -195,7 +194,6 @@ impl<V: PartialEq> ProjectionElem<V> {
195194
}
196195
ProjectionElem::Subslice { from, to } => ProjectionElem::Subslice { from, to },
197196
ProjectionElem::Downcast(variant_id) => ProjectionElem::Downcast(variant_id),
198-
ProjectionElem::OpaqueCast(ty) => ProjectionElem::OpaqueCast(ty),
199197
}
200198
}
201199

@@ -212,7 +210,6 @@ impl<V: PartialEq> ProjectionElem<V> {
212210
}
213211
ProjectionElem::Subslice { from, to } => ProjectionElem::Subslice { from, to },
214212
ProjectionElem::Downcast(variant_id) => ProjectionElem::Downcast(variant_id),
215-
ProjectionElem::OpaqueCast(ty) => ProjectionElem::OpaqueCast(ty),
216213
})
217214
}
218215
}
@@ -1257,7 +1254,7 @@ impl<'db> PlaceTy<'db> {
12571254
.instantiate(infcx.interner, args)
12581255
.skip_norm_wip()
12591256
}
1260-
// TODO TyKind::Coroutine...
1257+
// FIXME TyKind::Coroutine...
12611258
_ => panic!("can't downcast non-adt non-coroutine type: {self_ty:?}"),
12621259
}
12631260
} else {
@@ -1272,7 +1269,7 @@ impl<'db> PlaceTy<'db> {
12721269
TyKind::Closure(_, args) => {
12731270
args.as_closure().tupled_upvars_ty().tuple_fields()[f.0 as usize]
12741271
}
1275-
// TODO TyKind::Coroutine / TyKind::CoroutineClosure...
1272+
// FIXME TyKind::Coroutine / TyKind::CoroutineClosure...
12761273
TyKind::Tuple(tys) => tys
12771274
.get(f.0 as usize)
12781275
.cloned()
@@ -1360,7 +1357,6 @@ impl<'db> PlaceTy<'db> {
13601357
self.variant_id.clone(),
13611358
f,
13621359
)),
1363-
ProjectionElem::OpaqueCast(_ty) => unimplemented!("not emitted, to be removed"),
13641360
};
13651361
answer
13661362
}

crates/hir-ty/src/mir/borrowck.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,7 @@ fn place_case<'db>(
436436
| ProjectionElem::Index(_) => {
437437
is_part_of = true;
438438
}
439-
ProjectionElem::Downcast(_) |
440-
ProjectionElem::OpaqueCast(_) => (),
439+
ProjectionElem::Downcast(_) => (),
441440
}
442441
ty = ty.projection_ty(infcx, proj, env);
443442
}

crates/hir-ty/src/mir/eval.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,6 @@ impl<'a, 'db: 'a> Evaluator<'a, 'db> {
852852
ProjectionElem::Downcast(_) => {
853853
// no runtime effect
854854
}
855-
ProjectionElem::OpaqueCast(_) => not_supported!("opaque cast"),
856855
}
857856
}
858857
Ok((addr, ty.ty, metadata))

0 commit comments

Comments
 (0)