@@ -105,6 +105,7 @@ impl<'tcx> Stack {
105
105
}
106
106
107
107
// Check that the unique_range is a valid index into the borrow stack.
108
+ // This asserts that the unique_range's start <= end.
108
109
let uniques = & self . borrows [ self . unique_range . clone ( ) ] ;
109
110
110
111
// Check that the start of the unique_range is precise.
@@ -113,7 +114,7 @@ impl<'tcx> Stack {
113
114
}
114
115
// We cannot assert that the unique range is exact on the upper end.
115
116
// When we pop items within the unique range, setting the end of the range precisely
116
- // require doing a linear search of the borrow stack, which is exactly the kind of
117
+ // requires doing a linear search of the borrow stack, which is exactly the kind of
117
118
// operation that all this caching exists to avoid.
118
119
}
119
120
@@ -240,8 +241,8 @@ impl<'tcx> Stack {
240
241
self . unique_range . end += 1 ;
241
242
}
242
243
if new. perm ( ) == Permission :: Unique {
243
- // If this is the first Unique, set the range to contain just the new item.
244
- if self . unique_range == ( 0 .. 0 ) {
244
+ // If this is the only Unique, set the range to contain just the new item.
245
+ if self . unique_range . is_empty ( ) {
245
246
self . unique_range = new_idx..new_idx + 1 ;
246
247
} else {
247
248
// We already have other Unique items, expand the range to include the new item
0 commit comments