File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -346,23 +346,6 @@ impl<'tcx> Stack {
346
346
Ok ( ( ) )
347
347
}
348
348
349
- /// `reborrow` helper function: test that the stack invariants are still maintained.
350
- fn test_invariants ( & self ) {
351
- let mut saw_shared_read_only = false ;
352
- for item in self . borrows . iter ( ) {
353
- match item. perm {
354
- Permission :: SharedReadOnly => {
355
- saw_shared_read_only = true ;
356
- }
357
- // Otherwise, if we saw one before, that's a bug.
358
- perm if saw_shared_read_only => {
359
- bug ! ( "Found {:?} on top of a SharedReadOnly!" , perm) ;
360
- }
361
- _ => { }
362
- }
363
- }
364
- }
365
-
366
349
/// Derived a new pointer from one with the given tag.
367
350
/// `weak` controls whether this operation is weak or strong: weak granting does not act as
368
351
/// an access, and they add the new item directly on top of the one it is derived
@@ -418,11 +401,6 @@ impl<'tcx> Stack {
418
401
self . borrows . insert ( new_idx, new) ;
419
402
}
420
403
421
- // Make sure that after all this, the stack's invariant is still maintained.
422
- if cfg ! ( debug_assertions) {
423
- self . test_invariants ( ) ;
424
- }
425
-
426
404
Ok ( ( ) )
427
405
}
428
406
}
You can’t perform that action at this time.
0 commit comments