Skip to content

Commit 5987b0f

Browse files
committed
Use Place directly in place_as_reborrow, it's Copy
1 parent f37d2b8 commit 5987b0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_mir/transform/check_consts/validation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
260260

261261
// Special-case reborrows to be more like a copy of a reference.
262262
match *rvalue {
263-
Rvalue::Ref(_, kind, ref place) => {
263+
Rvalue::Ref(_, kind, place) => {
264264
if let Some(reborrowed_proj) = place_as_reborrow(self.tcx, *self.body, place) {
265265
let ctx = match kind {
266266
BorrowKind::Shared => {
@@ -281,7 +281,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
281281
return;
282282
}
283283
}
284-
Rvalue::AddressOf(mutbl, ref place) => {
284+
Rvalue::AddressOf(mutbl, place) => {
285285
if let Some(reborrowed_proj) = place_as_reborrow(self.tcx, *self.body, place) {
286286
let ctx = match mutbl {
287287
Mutability::Not => {
@@ -645,7 +645,7 @@ fn check_return_ty_is_sync(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, hir_id: HirId)
645645
fn place_as_reborrow(
646646
tcx: TyCtxt<'tcx>,
647647
body: &Body<'tcx>,
648-
place: &'a Place<'tcx>,
648+
place: Place<'tcx>,
649649
) -> Option<&'a [PlaceElem<'tcx>]> {
650650
place.projection.split_last().and_then(|(outermost, inner)| {
651651
if outermost != &ProjectionElem::Deref {

0 commit comments

Comments
 (0)