From 760bca4f5ba4fb717ff666da37f36c28f0219879 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 30 Mar 2020 19:22:12 -0300 Subject: [PATCH] Use Place directly on check_mut_borrowing_layout_constrained_field, it's Copy --- src/librustc_mir/transform/check_unsafety.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_mir/transform/check_unsafety.rs b/src/librustc_mir/transform/check_unsafety.rs index e0ff82b1e64..2367e83008c 100644 --- a/src/librustc_mir/transform/check_unsafety.rs +++ b/src/librustc_mir/transform/check_unsafety.rs @@ -184,7 +184,7 @@ fn visit_place(&mut self, place: &Place<'tcx>, context: PlaceContext, _location: // because either of these would allow modifying the layout constrained field and // insert values that violate the layout constraints. if context.is_mutating_use() || context.is_borrow() { - self.check_mut_borrowing_layout_constrained_field(place, context.is_mutating_use()); + self.check_mut_borrowing_layout_constrained_field(*place, context.is_mutating_use()); } for (i, elem) in place.projection.iter().enumerate() { @@ -382,7 +382,7 @@ fn register_violations( } fn check_mut_borrowing_layout_constrained_field( &mut self, - place: &Place<'tcx>, + place: Place<'tcx>, is_mut_use: bool, ) { let mut cursor = place.projection.as_ref(); -- 2.44.0