Skip to content

Commit 207d3bd

Browse files
committed
Change abs_diff return type to usize
1 parent a8e2a74 commit 207d3bd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

library/alloc/src/collections/vec_deque/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
388388
/// most one continuous overlapping region between src and dest).
389389
unsafe fn wrap_copy(&mut self, src: WrappedIndex, dst: WrappedIndex, len: usize) {
390390
debug_assert!(
391-
cmp::min(src.abs_diff(dst).as_index(), self.capacity() - src.abs_diff(dst).as_index())
392-
+ len
391+
cmp::min(src.abs_diff(dst), self.capacity() - src.abs_diff(dst)) + len
393392
<= self.capacity(),
394393
"wrc dst={} src={} len={} cap={}",
395394
dst,
@@ -3662,8 +3661,8 @@ mod index {
36623661
}
36633662

36643663
#[inline(always)]
3665-
pub(super) fn abs_diff(self, other: Self) -> Self {
3666-
Self(self.0.abs_diff(other.0))
3664+
pub(super) fn abs_diff(self, other: Self) -> usize {
3665+
self.0.abs_diff(other.0)
36673666
}
36683667

36693668
#[inline(always)]

src/etc/lldb_providers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ def get_child_at_index(self, index: int) -> Optional[SBValue]:
10621062

10631063
def update(self):
10641064
head = self.valobj.GetChildMemberWithName("head")
1065+
# BACKCOMPAT: rust 1.95
10651066
if head.GetType().num_fields == 1:
10661067
head = head.GetChildAtIndex(0)
10671068
self.head = head.GetValueAsUnsigned()

0 commit comments

Comments
 (0)