Skip to content

Commit 09014fc

Browse files
committed
Avoid cloning Place in report_cannot_move_from_static
1 parent 95e727a commit 09014fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc_mir/borrow_check/move_errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,15 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
283283
while let Some(box Projection { base: Some(ref proj), .. }) = base_static {
284284
base_static = &proj.base;
285285
}
286-
let base_static = Place {
287-
base: place.base.clone(),
288-
projection: base_static.clone(),
286+
let base_static = PlaceRef {
287+
base: &place.base,
288+
projection: base_static,
289289
};
290290

291291
format!(
292292
"`{:?}` as `{:?}` is a static item",
293293
self.describe_place(place.as_place_ref()).unwrap(),
294-
self.describe_place(base_static.as_place_ref()).unwrap(),
294+
self.describe_place(base_static).unwrap(),
295295
)
296296
};
297297

0 commit comments

Comments
 (0)