about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow
diff options
context:
space:
mode:
authorJannis Christopher Köhl <mail@koehl.dev>2022-09-04 12:29:49 +0200
committerJannis Christopher Köhl <mail@koehl.dev>2022-11-07 10:35:15 +0100
commite2ddf8a6e579ca1d92fdddd8bead46277c3261eb (patch)
tree8e556c020d37b2dd6dd54ff1b766b2224e37282a /compiler/rustc_mir_dataflow
parent1e5ca5701496a73d822b8dff220c7a8e8463724b (diff)
downloadrust-e2ddf8a6e579ca1d92fdddd8bead46277c3261eb.tar.gz
rust-e2ddf8a6e579ca1d92fdddd8bead46277c3261eb.zip
Add comment about downcast projection element
Diffstat (limited to 'compiler/rustc_mir_dataflow')
-rw-r--r--compiler/rustc_mir_dataflow/src/value_analysis.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs
index f625f71ccda..80d343e2b53 100644
--- a/compiler/rustc_mir_dataflow/src/value_analysis.rs
+++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs
@@ -582,7 +582,10 @@ impl Map {
 
         // Apply the projection.
         for &elem in projection {
-            // For now, downcast is not allowed (see #101168).
+            // For now, downcast is not allowed due to aliasing between variants (see #101168).
+            // Also, according to the documentation of [`Place`], a single-variant type can be
+            // projected with and without a [`ProjectionElem::Downcast`]. This creates an ambiguity
+            // that needs to be resolved.
             match elem {
                 PlaceElem::Downcast(..) => return Err(()),
                 _ => (),