diff options
| author | Aria Beingessner <a.beingessner@gmail.com> | 2022-03-22 01:24:55 -0400 |
|---|---|---|
| committer | Aria Beingessner <a.beingessner@gmail.com> | 2022-03-29 20:18:21 -0400 |
| commit | c7de289e1c8d24bd55aaa33813e509920a00c364 (patch) | |
| tree | b8dcd314558cc77fe1353c890c39c7026b7414b8 /library/alloc/src/vec | |
| parent | 5167b6891ccf05aa7a2191675e6c3da95d84374a (diff) | |
| download | rust-c7de289e1c8d24bd55aaa33813e509920a00c364.tar.gz rust-c7de289e1c8d24bd55aaa33813e509920a00c364.zip | |
Make the stdlib largely conform to strict provenance.
Some things like the unwinders and system APIs are not fully conformant, this only covers a lot of low-hanging fruit.
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/into_iter.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec/into_iter.rs b/library/alloc/src/vec/into_iter.rs index f17b8d71b3a..cc6dfb0e330 100644 --- a/library/alloc/src/vec/into_iter.rs +++ b/library/alloc/src/vec/into_iter.rs @@ -159,7 +159,7 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> { #[inline] fn size_hint(&self) -> (usize, Option<usize>) { let exact = if mem::size_of::<T>() == 0 { - (self.end as usize).wrapping_sub(self.ptr as usize) + self.end.addr().wrapping_sub(self.ptr.addr()) } else { unsafe { self.end.offset_from(self.ptr) as usize } }; |
