|
1 | 1 | use smallvec::SmallVec; |
2 | 2 | use std::fmt; |
3 | 3 |
|
4 | | -use rustc_middle::mir::interpret::{alloc_range, AllocId, AllocRange}; |
| 4 | +use rustc_middle::mir::interpret::{alloc_range, AllocId, AllocRange, InterpError}; |
5 | 5 | use rustc_span::{Span, SpanData}; |
6 | 6 | use rustc_target::abi::Size; |
7 | 7 |
|
8 | | -use crate::stacked_borrows::{ |
9 | | - err_sb_ub, AccessKind, GlobalStateInner, Permission, ProtectorKind, Stack, |
| 8 | +use crate::borrow_tracker::{ |
| 9 | + stacked_borrows::{err_sb_ub, Permission}, |
| 10 | + AccessKind, GlobalStateInner, ProtectorKind, |
10 | 11 | }; |
11 | 12 | use crate::*; |
12 | 13 |
|
13 | | -use rustc_middle::mir::interpret::InterpError; |
14 | | - |
15 | 14 | #[derive(Clone, Debug)] |
16 | 15 | pub struct AllocHistory { |
17 | 16 | id: AllocId, |
@@ -53,7 +52,7 @@ impl Creation { |
53 | 52 |
|
54 | 53 | #[derive(Clone, Debug)] |
55 | 54 | struct Invalidation { |
56 | | - tag: SbTag, |
| 55 | + tag: BorTag, |
57 | 56 | range: AllocRange, |
58 | 57 | span: Span, |
59 | 58 | cause: InvalidationCause, |
@@ -100,7 +99,7 @@ impl fmt::Display for InvalidationCause { |
100 | 99 |
|
101 | 100 | #[derive(Clone, Debug)] |
102 | 101 | struct Protection { |
103 | | - tag: SbTag, |
| 102 | + tag: BorTag, |
104 | 103 | span: Span, |
105 | 104 | } |
106 | 105 |
|
@@ -135,7 +134,7 @@ impl<'ecx, 'mir, 'tcx> DiagnosticCxBuilder<'ecx, 'mir, 'tcx> { |
135 | 134 | pub fn retag( |
136 | 135 | machine: &'ecx MiriMachine<'mir, 'tcx>, |
137 | 136 | cause: RetagCause, |
138 | | - new_tag: SbTag, |
| 137 | + new_tag: BorTag, |
139 | 138 | orig_tag: ProvenanceExtra, |
140 | 139 | range: AllocRange, |
141 | 140 | ) -> Self { |
@@ -185,7 +184,7 @@ enum Operation { |
185 | 184 | #[derive(Debug, Clone)] |
186 | 185 | struct RetagOp { |
187 | 186 | cause: RetagCause, |
188 | | - new_tag: SbTag, |
| 187 | + new_tag: BorTag, |
189 | 188 | orig_tag: ProvenanceExtra, |
190 | 189 | range: AllocRange, |
191 | 190 | permission: Option<Permission>, |
@@ -257,7 +256,7 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> { |
257 | 256 | .push(Creation { retag: op.clone(), span: self.machine.current_span() }); |
258 | 257 | } |
259 | 258 |
|
260 | | - pub fn log_invalidation(&mut self, tag: SbTag) { |
| 259 | + pub fn log_invalidation(&mut self, tag: BorTag) { |
261 | 260 | let mut span = self.machine.current_span(); |
262 | 261 | let (range, cause) = match &self.operation { |
263 | 262 | Operation::Retag(RetagOp { cause, range, permission, .. }) => { |
@@ -288,8 +287,8 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> { |
288 | 287 |
|
289 | 288 | pub fn get_logs_relevant_to( |
290 | 289 | &self, |
291 | | - tag: SbTag, |
292 | | - protector_tag: Option<SbTag>, |
| 290 | + tag: BorTag, |
| 291 | + protector_tag: Option<BorTag>, |
293 | 292 | ) -> Option<TagHistory> { |
294 | 293 | let Some(created) = self.history |
295 | 294 | .creations |
@@ -410,7 +409,7 @@ impl<'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'history, 'ecx, 'mir, 'tcx> { |
410 | 409 | .all_stacks() |
411 | 410 | .flatten() |
412 | 411 | .map(|frame| { |
413 | | - frame.extra.stacked_borrows.as_ref().expect("we should have Stacked Borrows data") |
| 412 | + frame.extra.borrow_tracker.as_ref().expect("we should have borrow tracking data") |
414 | 413 | }) |
415 | 414 | .find(|frame| frame.protected_tags.contains(&item.tag())) |
416 | 415 | .map(|frame| frame.call_id) |
|
0 commit comments