1
Fork 0

Add docs, remove code, change subtyper code

This commit is contained in:
ouz-a 2023-08-28 11:19:19 +03:00
parent 3148e6a993
commit cd7f471931
24 changed files with 106 additions and 363 deletions

View file

@ -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