diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2019-07-19 20:46:16 +0200 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2019-07-20 05:08:39 +0200 |
| commit | 09014fc793fb0030f98af215d56350b07a8b4d64 (patch) | |
| tree | baf5912f5234753d21c11de86c011d67c000d21c | |
| parent | 95e727a5c3799f3eaf6ead0b203087cf30cc7206 (diff) | |
Avoid cloning Place in report_cannot_move_from_static
| -rw-r--r-- | src/librustc_mir/borrow_check/move_errors.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs index cbeedd31730..b21d3698c83 100644 --- a/src/librustc_mir/borrow_check/move_errors.rs +++ b/src/librustc_mir/borrow_check/move_errors.rs @@ -283,15 +283,15 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { while let Some(box Projection { base: Some(ref proj), .. }) = base_static { base_static = &proj.base; } - let base_static = Place { - base: place.base.clone(), - projection: base_static.clone(), + let base_static = PlaceRef { + base: &place.base, + projection: base_static, }; format!( "`{:?}` as `{:?}` is a static item", self.describe_place(place.as_place_ref()).unwrap(), - self.describe_place(base_static.as_place_ref()).unwrap(), + self.describe_place(base_static).unwrap(), ) }; |
