diff options
| author | ouz-a <ouz.agz@gmail.com> | 2023-08-28 11:19:19 +0300 |
|---|---|---|
| committer | ouz-a <ouz.agz@gmail.com> | 2023-10-02 23:39:44 +0300 |
| commit | cd7f47193182d1d557a83593bcff6afe0568fc53 (patch) | |
| tree | 5ae299b1d8d300839a57994f58b37d0f20541594 /compiler/rustc_mir_dataflow/src | |
| parent | 3148e6a9933b17b28ed6c7b8d8bd6c8e49fe4a50 (diff) | |
| download | rust-cd7f47193182d1d557a83593bcff6afe0568fc53.tar.gz rust-cd7f47193182d1d557a83593bcff6afe0568fc53.zip | |
Add docs, remove code, change subtyper code
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/move_paths/builder.rs | 9 |
1 files changed, 5 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 0e4fc2447e1..4447ff0798c 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs @@ -112,9 +112,8 @@ 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()) { - if elem.is_subtype() { - continue; - } + // 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; @@ -233,7 +232,9 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> { // `OpaqueCast` only transmutes the type, so no moves there and // `Downcast` only changes information about a `Place` without moving // So it's safe to skip these. - ProjectionElem::OpaqueCast(_) | ProjectionElem::Downcast(_, _) => (), + ProjectionElem::OpaqueCast(_) + | ProjectionElem::Subtype(_) + | ProjectionElem::Downcast(_, _) => (), } if union_path.is_none() { // inlined from add_move_path because of a borrowck conflict with the iterator |
