Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 760bca4

Browse files
committed
Use Place directly on check_mut_borrowing_layout_constrained_field, it's Copy
1 parent 32a7618 commit 760bca4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_mir/transform/check_unsafety.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
184184
// because either of these would allow modifying the layout constrained field and
185185
// insert values that violate the layout constraints.
186186
if context.is_mutating_use() || context.is_borrow() {
187-
self.check_mut_borrowing_layout_constrained_field(place, context.is_mutating_use());
187+
self.check_mut_borrowing_layout_constrained_field(*place, context.is_mutating_use());
188188
}
189189

190190
for (i, elem) in place.projection.iter().enumerate() {
@@ -382,7 +382,7 @@ impl<'a, 'tcx> UnsafetyChecker<'a, 'tcx> {
382382
}
383383
fn check_mut_borrowing_layout_constrained_field(
384384
&mut self,
385-
place: &Place<'tcx>,
385+
place: Place<'tcx>,
386386
is_mut_use: bool,
387387
) {
388388
let mut cursor = place.projection.as_ref();

0 commit comments

Comments
 (0)