Lines Matching refs:next
28 /// only have one `ListArc` (for each pair of prev/next pointers), this ensures that the same
29 /// prev/next pointers are not used for several linked lists.
35 /// * All prev/next pointers in `ListLinks` fields of items in the list are valid and form a cycle.
91 /// * The returned pointer is valid until the next call to `post_remove`.
136 next: *mut ListLinksFields,
140 /// The prev/next pointers for an item in a linked list.
168 next: ptr::null_mut(),
226 next: ptr::null_mut(),
267 (*item).next = item;
271 let next = self.first;
274 let prev = unsafe { (*next).prev };
277 // INVARIANT: This correctly inserts `item` between `prev` and `next`.
279 (*item).next = next;
281 (*prev).next = item;
282 (*next).prev = item;
306 (*item).next = item;
310 let next = self.first;
311 // SAFETY: We just checked that `next` is non-null.
312 let prev = unsafe { (*next).prev };
315 // INVARIANT: This correctly inserts `item` between `prev` and `next`.
317 (*item).next = next;
319 (*prev).next = item;
320 (*next).prev = item;
368 let ListLinksFields { next, prev } = unsafe { *item };
370 debug_assert_eq!(next.is_null(), prev.is_null());
371 if !next.is_null() {
377 // SAFETY: We just checked that `next` is not null, and it's not dangling by the
380 debug_assert_eq!(item, (*next).prev);
381 item = (*next).prev;
386 Some(unsafe { self.remove_internal_inner(item, next, prev) })
400 let ListLinksFields { next, prev } = unsafe { *item };
402 unsafe { self.remove_internal_inner(item, next, prev) }
409 /// The `item` pointer must point at an item in this list, and we must have `(*item).next ==
410 /// next` and `(*item).prev == prev`.
414 next: *mut ListLinksFields,
417 // SAFETY: We have exclusive access to the pointers of items in the list, and the prev/next
421 // * If the list has at least three items, then after removing the item, `prev` and `next`
422 // will be next to each other.
424 // * If the list has one item, then `next == prev == item`, so these writes have no
427 (*next).prev = prev;
428 (*prev).next = next;
434 (*item).next = ptr::null_mut();
439 // `prev->next` to `next`, which is the new first item, and setting `item->next` to null
440 // did not modify `prev->next`.
442 // `item->next` to null, so this correctly sets `first` to null now that the list is
448 self.first = unsafe { (*prev).next };
482 (*other_last).next = self_first;
483 (*self_last).next = other_first;
549 fn next(&mut self) -> Option<ArcBorrow<'a, T>> {
558 let next = unsafe { (*current).next };
560 // Otherwise, we update it to the next element.
561 self.current = if next != self.stop {
562 next
607 /// Move the cursor to the next element.
608 pub fn next(self) -> Option<Cursor<'a, T, ID>> {
610 let next = unsafe { (*self.current).next };
612 if next == self.list.first {
615 // INVARIANT: Since `self.current` is in the `list`, its `next` pointer is also in the
618 current: next,
667 fn next(&mut self) -> Option<ListArc<T, ID>> {