diff options
| author | ouz-a <ouz.agz@gmail.com> | 2023-08-16 08:43:30 +0300 |
|---|---|---|
| committer | ouz-a <ouz.agz@gmail.com> | 2023-10-02 23:37:49 +0300 |
| commit | 3148e6a9933b17b28ed6c7b8d8bd6c8e49fe4a50 (patch) | |
| tree | 15b25c07516fd4df1199c59c59464fdf0dea0b89 /compiler/rustc_mir_dataflow | |
| parent | 177091258c039398d30137b52e1c575a98aa7597 (diff) | |
| download | rust-3148e6a9933b17b28ed6c7b8d8bd6c8e49fe4a50.tar.gz rust-3148e6a9933b17b28ed6c7b8d8bd6c8e49fe4a50.zip | |
subtyping_projections
Diffstat (limited to 'compiler/rustc_mir_dataflow')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/move_paths/builder.rs | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs b/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs index 7806e8f45d3..2a7f23ef6d2 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs @@ -57,6 +57,7 @@ impl<'tcx> Lift for PlaceElem<'tcx> { ProjectionElem::ConstantIndex { offset, min_length, from_end } } ProjectionElem::Downcast(a, u) => ProjectionElem::Downcast(a, u), + ProjectionElem::Subtype(ty) => ProjectionElem::Subtype(ty.lift()), } } } diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs index 9ced3a7f3cd..0e4fc2447e1 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs @@ -112,6 +112,9 @@ 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; + } let body = self.builder.body; let tcx = self.builder.tcx; let place_ty = place_ref.ty(body, tcx).ty; |
