1
Fork 0

interpret: project_downcast: do not ICE for uninhabited variants

This commit is contained in:
Ralf Jung 2024-01-26 08:22:05 +01:00
parent 69db514ed9
commit 1025a12b64
4 changed files with 30 additions and 19 deletions

View file

@ -1074,6 +1074,8 @@ pub enum ProjectionElem<V, T> {
/// "Downcast" to a variant of an enum or a coroutine.
///
/// The included Symbol is the name of the variant, used for printing MIR.
///
/// This operation itself is never UB, all it does is change the type of the place.
Downcast(Option<Symbol>, VariantIdx),
/// Like an explicit cast from an opaque type to a concrete type, but without