|
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::borrow_tracker::{ |
| 9 | + stacked::{err_sb_ub, Permission}, |
| 10 | + AccessKind, GlobalStateInner, |
| 11 | + ProtectorKind, |
| 12 | +}; |
8 | 13 | use crate::helpers::CurrentSpan; |
9 | | -use crate::stacked_borrows::{err_sb_ub, AccessKind, GlobalStateInner, Permission, ProtectorKind}; |
10 | 14 | use crate::*; |
11 | 15 |
|
12 | | -use rustc_middle::mir::interpret::InterpError; |
13 | | - |
14 | 16 | #[derive(Clone, Debug)] |
15 | 17 | pub struct AllocHistory { |
16 | 18 | id: AllocId, |
@@ -52,7 +54,7 @@ impl Creation { |
52 | 54 |
|
53 | 55 | #[derive(Clone, Debug)] |
54 | 56 | struct Invalidation { |
55 | | - tag: SbTag, |
| 57 | + tag: BorTag, |
56 | 58 | range: AllocRange, |
57 | 59 | span: Span, |
58 | 60 | cause: InvalidationCause, |
@@ -99,7 +101,7 @@ impl fmt::Display for InvalidationCause { |
99 | 101 |
|
100 | 102 | #[derive(Clone, Debug)] |
101 | 103 | struct Protection { |
102 | | - tag: SbTag, |
| 104 | + tag: BorTag, |
103 | 105 | span: Span, |
104 | 106 | } |
105 | 107 |
|
@@ -147,7 +149,7 @@ impl<'span, 'ecx, 'mir, 'tcx> DiagnosticCxBuilder<'span, 'ecx, 'mir, 'tcx> { |
147 | 149 | current_span: &'span mut CurrentSpan<'ecx, 'mir, 'tcx>, |
148 | 150 | threads: &'ecx ThreadManager<'mir, 'tcx>, |
149 | 151 | cause: RetagCause, |
150 | | - new_tag: SbTag, |
| 152 | + new_tag: BorTag, |
151 | 153 | orig_tag: ProvenanceExtra, |
152 | 154 | range: AllocRange, |
153 | 155 | ) -> Self { |
@@ -207,7 +209,7 @@ enum Operation { |
207 | 209 | #[derive(Debug, Clone)] |
208 | 210 | struct RetagOp { |
209 | 211 | cause: RetagCause, |
210 | | - new_tag: SbTag, |
| 212 | + new_tag: BorTag, |
211 | 213 | orig_tag: ProvenanceExtra, |
212 | 214 | range: AllocRange, |
213 | 215 | permission: Option<Permission>, |
@@ -277,7 +279,7 @@ impl<'span, 'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'span, 'history, 'ecx, 'mir |
277 | 279 | self.history.creations.push(Creation { retag: op.clone(), span: self.current_span.get() }); |
278 | 280 | } |
279 | 281 |
|
280 | | - pub fn log_invalidation(&mut self, tag: SbTag) { |
| 282 | + pub fn log_invalidation(&mut self, tag: BorTag) { |
281 | 283 | let mut span = self.current_span.get(); |
282 | 284 | let (range, cause) = match &self.operation { |
283 | 285 | Operation::Retag(RetagOp { cause, range, permission, .. }) => { |
@@ -306,8 +308,8 @@ impl<'span, 'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'span, 'history, 'ecx, 'mir |
306 | 308 |
|
307 | 309 | pub fn get_logs_relevant_to( |
308 | 310 | &self, |
309 | | - tag: SbTag, |
310 | | - protector_tag: Option<SbTag>, |
| 311 | + tag: BorTag, |
| 312 | + protector_tag: Option<BorTag>, |
311 | 313 | ) -> Option<TagHistory> { |
312 | 314 | let Some(created) = self.history |
313 | 315 | .creations |
@@ -422,7 +424,7 @@ impl<'span, 'history, 'ecx, 'mir, 'tcx> DiagnosticCx<'span, 'history, 'ecx, 'mir |
422 | 424 | .all_stacks() |
423 | 425 | .flatten() |
424 | 426 | .map(|frame| { |
425 | | - frame.extra.stacked_borrows.as_ref().expect("we should have Stacked Borrows data") |
| 427 | + frame.extra.borrow_tracker.as_ref().expect("we should have Stacked Borrows data") |
426 | 428 | }) |
427 | 429 | .find(|frame| frame.protected_tags.contains(&item.tag())) |
428 | 430 | .map(|frame| frame.call_id) |
|
0 commit comments