diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2020-03-31 14:16:54 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2020-03-31 17:37:48 -0300 |
| commit | 5987b0f8bed3d6c1bf6c167f850d45f2439ed569 (patch) | |
| tree | 179d5d555fedbc1a5d13cfc54cc958c5b84c92a5 | |
| parent | f37d2b8a633016a5269bf14b12f61fa8ab85d1da (diff) | |
| download | rust-5987b0f8bed3d6c1bf6c167f850d45f2439ed569.tar.gz rust-5987b0f8bed3d6c1bf6c167f850d45f2439ed569.zip | |
Use Place directly in place_as_reborrow, it's Copy
| -rw-r--r-- | src/librustc_mir/transform/check_consts/validation.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_mir/transform/check_consts/validation.rs b/src/librustc_mir/transform/check_consts/validation.rs index c8320a1561a..649cc0a79d6 100644 --- a/src/librustc_mir/transform/check_consts/validation.rs +++ b/src/librustc_mir/transform/check_consts/validation.rs @@ -260,7 +260,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> { // Special-case reborrows to be more like a copy of a reference. match *rvalue { - Rvalue::Ref(_, kind, ref place) => { + Rvalue::Ref(_, kind, place) => { if let Some(reborrowed_proj) = place_as_reborrow(self.tcx, *self.body, place) { let ctx = match kind { BorrowKind::Shared => { @@ -281,7 +281,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> { return; } } - Rvalue::AddressOf(mutbl, ref place) => { + Rvalue::AddressOf(mutbl, place) => { if let Some(reborrowed_proj) = place_as_reborrow(self.tcx, *self.body, place) { let ctx = match mutbl { Mutability::Not => { @@ -645,7 +645,7 @@ fn check_return_ty_is_sync(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, hir_id: HirId) fn place_as_reborrow( tcx: TyCtxt<'tcx>, body: &Body<'tcx>, - place: &'a Place<'tcx>, + place: Place<'tcx>, ) -> Option<&'a [PlaceElem<'tcx>]> { place.projection.split_last().and_then(|(outermost, inner)| { if outermost != &ProjectionElem::Deref { |
