summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow
diff options
context:
space:
mode:
authorouz-a <ouz.agz@gmail.com>2023-10-02 11:22:48 +0300
committerouz-a <ouz.agz@gmail.com>2023-10-02 23:39:45 +0300
commit5d753abb300eebfb6492dc2b47bd32052a322b71 (patch)
tree2209d4af7e8fb773bbe592d11e2428a1c3f52bb6 /compiler/rustc_mir_dataflow
parent6f0c5ee2d4c9ced0fa9d0e698b6a136cfdc51949 (diff)
downloadrust-5d753abb300eebfb6492dc2b47bd32052a322b71.tar.gz
rust-5d753abb300eebfb6492dc2b47bd32052a322b71.zip
have better explanation for `relate_types`
Diffstat (limited to 'compiler/rustc_mir_dataflow')
-rw-r--r--compiler/rustc_mir_dataflow/src/move_paths/builder.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs
index 4447ff0798c..7a5b3585d59 100644
--- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs
+++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs
@@ -112,8 +112,6 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
         let mut union_path = None;
 
         for (place_ref, elem) in data.rev_lookup.un_derefer.iter_projections(place.as_ref()) {
-            // We don't care creating `MovePath` for `ProjectionElem::Subtype(T)` because it's for debugging/validating
-            // purposes it's movement doesn't affect anything.
             let body = self.builder.body;
             let tcx = self.builder.tcx;
             let place_ty = place_ref.ty(body, tcx).ty;
@@ -229,8 +227,9 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
                     }
                     _ => bug!("Unexpected type {place_ty:#?}"),
                 },
-                // `OpaqueCast` only transmutes the type, so no moves there and
-                // `Downcast` only changes information about a `Place` without moving
+                // `OpaqueCast`:Only transmutes the type, so no moves there.
+                // `Downcast`  :Only changes information about a `Place` without moving.
+                // `Subtype`   :Only transmutes the type, so moves.
                 // So it's safe to skip these.
                 ProjectionElem::OpaqueCast(_)
                 | ProjectionElem::Subtype(_)