Skip to content

Commit 62080c1

Browse files
committed
fn method not needed
1 parent 01bdccb commit 62080c1

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/borrow_tracker/mod.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl VisitTags for FrameExtra {
8181
/// Extra global state, available to the memory access hooks.
8282
#[derive(Debug)]
8383
pub struct GlobalStateInner {
84-
/// Borrow tracker method currently in use (except BorrowTrackerMethod::Off)
84+
/// Borrow tracker method currently in use.
8585
pub borrow_tracker_method: BorrowTrackerMethod,
8686
/// Next unused pointer ID (tag).
8787
pub next_ptr_tag: BorTag,
@@ -183,11 +183,6 @@ impl GlobalStateInner {
183183
}
184184
}
185185

186-
/// Return the borrow tracker method
187-
pub fn method(&self) -> BorrowTrackerMethod {
188-
self.borrow_tracker_method
189-
}
190-
191186
/// Generates a new pointer tag. Remember to also check track_pointer_tags and log its creation!
192187
pub fn new_ptr(&mut self) -> BorTag {
193188
let id = self.next_ptr_tag;
@@ -272,23 +267,23 @@ impl<'mir, 'tcx: 'mir> EvalContextExt<'mir, 'tcx> for crate::MiriInterpCx<'mir,
272267
pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
273268
fn retag(&mut self, kind: RetagKind, place: &PlaceTy<'tcx, Provenance>) -> InterpResult<'tcx> {
274269
let this = self.eval_context_mut();
275-
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().method();
270+
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
276271
match method {
277272
BorrowTrackerMethod::StackedBorrows => this.sb_retag(kind, place),
278273
}
279274
}
280275

281276
fn retag_return_place(&mut self) -> InterpResult<'tcx> {
282277
let this = self.eval_context_mut();
283-
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().method();
278+
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
284279
match method {
285280
BorrowTrackerMethod::StackedBorrows => this.sb_retag_return_place(),
286281
}
287282
}
288283

289284
fn expose_tag(&mut self, alloc_id: AllocId, tag: BorTag) -> InterpResult<'tcx> {
290285
let this = self.eval_context_mut();
291-
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().method();
286+
let method = this.machine.borrow_tracker.as_ref().unwrap().borrow().borrow_tracker_method;
292287
match method {
293288
BorrowTrackerMethod::StackedBorrows => this.sb_expose_tag(alloc_id, tag),
294289
}

src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl Stacks {
501501
Ok(())
502502
}
503503

504-
pub fn expose_tag(&mut self, tag: BorTag) {
504+
fn expose_tag(&mut self, tag: BorTag) {
505505
self.exposed_tags.insert(tag);
506506
}
507507
}

0 commit comments

Comments
 (0)