Skip to content

Commit

Permalink
Auto merge of rust-lang#105456 - matthiaskrgr:rollup-yennygf, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#104922 (Detect long types in E0308 and write them to disk)
 - rust-lang#105120 (kmc-solid: `std::sys` code maintenance)
 - rust-lang#105255 (Make nested RPIT inherit the parent opaque's generics.)
 - rust-lang#105317 (make retagging work even with 'unstable' places)
 - rust-lang#105405 (Stop passing -export-dynamic to wasm-ld.)
 - rust-lang#105408 (Add help for `#![feature(impl_trait_in_fn_trait_return)]`)
 - rust-lang#105423 (Use `Symbol` for the crate name instead of `String`/`str`)
 - rust-lang#105433 (CI: add missing line continuation marker)
 - rust-lang#105434 (Fix warning when libcore is compiled with no_fp_fmt_parse)
 - rust-lang#105441 (Remove `UnsafetyState`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Dec 9, 2022
2 parents 98ad06d + 51f7122 commit 0208c4c
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 179 deletions.
13 changes: 10 additions & 3 deletions src/borrow_tracker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use rustc_target::abi::Size;

use crate::*;
pub mod stacked_borrows;
use stacked_borrows::diagnostics::RetagCause;

pub type CallId = NonZeroU64;

Expand Down Expand Up @@ -265,11 +264,19 @@ impl GlobalStateInner {

impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir, 'tcx> {}
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
fn retag(&mut self, kind: RetagKind, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx> {
fn retag_ptr_value(&mut self, kind: RetagKind, val: &ImmTy<'tcx, Provenance>) -> InterpResult<'tcx, ImmTy<'tcx, Provenance>> {
let this = self.eval_context_mut();
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
match method {
BorrowTrackerMethod::StackedBorrows => this.sb_retag(kind, place),
BorrowTrackerMethod::StackedBorrows => this.sb_retag_ptr_value(kind, val),
}
}

fn retag_place_contents(&mut self, kind: RetagKind, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx> {
let this = self.eval_context_mut();
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
match method {
BorrowTrackerMethod::StackedBorrows => this.sb_retag_place_contents(kind, place),
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/borrow_tracker/stacked_borrows/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> {
Operation::Dealloc(_) => format!(" due to deallocation"),
Operation::Access(AccessOp { kind, tag, .. }) =>
format!(" due to {kind:?} access for {tag:?}"),
Operation::Retag(RetagOp { orig_tag, permission, .. }) => {
Operation::Retag(RetagOp { orig_tag, permission, new_tag, .. }) => {
let permission = permission
.expect("start_grant should set the current permission before popping a tag");
format!(" due to {permission:?} retag from {orig_tag:?}")
format!(" due to {permission:?} retag from {orig_tag:?} (that retag created {new_tag:?})")
}
};

Expand Down
Loading

0 comments on commit 0208c4c

Please sign in to comment.