about summary refs log tree commit diff
path: root/compiler/stable_mir/src/mir
diff options
context:
space:
mode:
authorKirby Linvill <kjlinvill@gmail.com>2023-11-14 19:19:35 -0700
committerKirby Linvill <kjlinvill@gmail.com>2023-11-14 19:19:35 -0700
commitc036a10ed501cd2c4b501af03c920af3f28d360f (patch)
tree7a90c646262ea9ec6ed061d562d7f063848bff1a /compiler/stable_mir/src/mir
parentae1726bfceffa271131d9ef852c1d553688aa6a4 (diff)
downloadrust-c036a10ed501cd2c4b501af03c920af3f28d360f.tar.gz
rust-c036a10ed501cd2c4b501af03c920af3f28d360f.zip
Make UserTypeProjection projections Opaque
Also shifts comments explaining why Stable MIR drops an optional variant
name field, for `Downcast` projection elements, to the `Place::stable`
function.
Diffstat (limited to 'compiler/stable_mir/src/mir')
-rw-r--r--compiler/stable_mir/src/mir/body.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/stable_mir/src/mir/body.rs b/compiler/stable_mir/src/mir/body.rs
index a5b51ce6a34..351e7bb69c3 100644
--- a/compiler/stable_mir/src/mir/body.rs
+++ b/compiler/stable_mir/src/mir/body.rs
@@ -465,10 +465,6 @@ pub enum ProjectionElem {
     },
 
     /// "Downcast" to a variant of an enum or a coroutine.
-    //
-    // TODO(klinvill): MIR includes an Option<Symbol> argument that is the name of the variant, used
-    // for printing MIR. However I don't see it used anywhere. Is such a field needed or can we just
-    // include the VariantIdx which could be used to recover the field name if needed?
     Downcast(VariantIdx),
 
     /// Like an explicit cast from an opaque type to a concrete type, but without
@@ -488,7 +484,7 @@ pub enum ProjectionElem {
 pub struct UserTypeProjection {
     pub base: UserTypeAnnotationIndex,
 
-    pub projection: String,
+    pub projection: Opaque,
 }
 
 pub type Local = usize;