Add comment about downcast projection element

This commit is contained in:
Jannis Christopher Köhl 2022-09-04 12:29:49 +02:00
parent 1e5ca57014
commit e2ddf8a6e5

View File

@ -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(()),
_ => (),