Skip to content

Commit

Permalink
Avoid cloning Place in report_cannot_move_from_static
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jul 20, 2019
1 parent 95e727a commit 09014fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_mir/borrow_check/move_errors.rs
Expand Up @@ -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(),
)
};

Expand Down

0 comments on commit 09014fc

Please sign in to comment.