Skip to content

Commit ce7efa3

Browse files
committed
Auto merge of #114481 - matthiaskrgr:rollup-58pczpl, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #113945 (Fix wrong span for trait selection failure error reporting) - #114351 ([rustc_span][perf] Remove unnecessary string joins and allocs.) - #114418 (bump parking_lot to 0.12) - #114434 (Improve spans for indexing expressions) - #114450 (Fix ICE failed to get layout for ReferencesError) - #114461 (Fix unwrap on None) - #114462 (interpret: add mplace_to_ref helper method) - #114472 (Reword `confusable_idents` lint) - #114477 (Account for `Rc` and `Arc` when suggesting to clone) r? `@ghost` `@rustbot` modify labels: rollup
2 parents bf71df7 + 06a0b10 commit ce7efa3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/borrow_tracker/stacked_borrows/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_data_structures::fx::FxHashSet;
1515
use rustc_middle::mir::{Mutability, RetagKind};
1616
use rustc_middle::ty::{
1717
self,
18-
layout::{HasParamEnv, LayoutOf},
18+
layout::HasParamEnv,
1919
Ty,
2020
};
2121
use rustc_target::abi::{Abi, Align, Size};
@@ -993,8 +993,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
993993

994994
// We have to turn the place into a pointer to use the usual retagging logic.
995995
// (The pointer type does not matter, so we use a raw pointer.)
996-
let ptr_layout = this.layout_of(Ty::new_mut_ptr(this.tcx.tcx, place.layout.ty))?;
997-
let ptr = ImmTy::from_immediate(place.to_ref(this), ptr_layout);
996+
let ptr = this.mplace_to_ref(place)?;
998997
// Reborrow it. With protection! That is the entire point.
999998
let new_perm = NewPermission::Uniform {
1000999
perm: Permission::Unique,

src/borrow_tracker/tree_borrows/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_middle::{
77
mir::{Mutability, RetagKind},
88
ty::{
99
self,
10-
layout::{HasParamEnv, LayoutOf},
10+
layout::HasParamEnv,
1111
Ty,
1212
},
1313
};
@@ -488,8 +488,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
488488

489489
// We have to turn the place into a pointer to use the usual retagging logic.
490490
// (The pointer type does not matter, so we use a raw pointer.)
491-
let ptr_layout = this.layout_of(Ty::new_mut_ptr(this.tcx.tcx, place.layout.ty))?;
492-
let ptr = ImmTy::from_immediate(place.to_ref(this), ptr_layout);
491+
let ptr = this.mplace_to_ref(place)?;
493492
// Reborrow it. With protection! That is the entire point.
494493
let new_perm = NewPermission {
495494
initial_state: Permission::new_active(),

0 commit comments

Comments
 (0)