Skip to content

Commit f521fd5

Browse files
committed
let's call this a redundant reborrow
1 parent c234009 commit f521fd5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stacked_borrows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,17 @@ impl<'tcx> Stacks {
337337
// the stack than the one we come from, just use that.
338338
// IOW, we check if `new_bor` *already* is "derived from" `ptr.tag`.
339339
// This also checks frozenness, if required.
340-
let bor_already_happened = match (ptr_idx, stack.deref(new_bor, new_kind)) {
340+
let bor_redundant = match (ptr_idx, stack.deref(new_bor, new_kind)) {
341341
// If the new borrow works with the frozen item, or else if it lives
342342
// above the old one in the stack, our job here is done.
343343
(_, Ok(None)) => true,
344344
(Some(ptr_idx), Ok(Some(new_idx))) if new_idx >= ptr_idx => true,
345345
// Otherwise we need to create a new borrow.
346346
_ => false,
347347
};
348-
if bor_already_happened {
348+
if bor_redundant {
349349
assert!(new_bor.is_shared(), "A unique reborrow can never be redundant");
350-
trace!("Reborrow is a NOP");
350+
trace!("reborrow is redundant");
351351
continue;
352352
}
353353
// We need to do some actual work.

0 commit comments

Comments
 (0)