Skip to content

Commit b59ded8

Browse files
committed
Avoid cloning Place in visit_rvalue
1 parent 7789cbf commit b59ded8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_mir/transform/qualify_consts.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1199,10 +1199,10 @@ impl<'a, 'tcx> Visitor<'tcx> for Checker<'a, 'tcx> {
11991199
MutatingUseContext::Borrow,
12001200
),
12011201
};
1202-
self.visit_place(&Place {
1203-
base: place.base.clone(),
1204-
projection: proj.clone(),
1205-
}, ctx, location);
1202+
self.visit_place_base(&place.base, ctx, location);
1203+
if let Some(proj) = proj {
1204+
self.visit_projection(&place.base, proj, ctx, location);
1205+
}
12061206
} else {
12071207
self.super_rvalue(rvalue, location);
12081208
}

0 commit comments

Comments
 (0)