about summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-08-22 20:34:15 +0530
committerGitHub <noreply@github.com>2022-08-22 20:34:15 +0530
commit58d23737a6d77c88af6b9b600058877910db1bff (patch)
tree4a523ca51052626d9d4740324d442c58cc8b46fc /library/alloc/src/vec
parent75b7089d1efbb80c810ce906ff96a9da8bdd9a9c (diff)
parentefef211876b193ebc5e33dc9414c5a3dc14e9739 (diff)
downloadrust-58d23737a6d77c88af6b9b600058877910db1bff.tar.gz
rust-58d23737a6d77c88af6b9b600058877910db1bff.zip
Rollup merge of #100820 - WaffleLapkin:use_ptr_is_aligned_methods, r=scottmcm
Use pointer `is_aligned*` methods

This PR replaces some manual alignment checks with calls to `pointer::{is_aligned, is_aligned_to}` and removes a useless pointer cast.

r? `@scottmcm`

_split off from #100746_
Diffstat (limited to 'library/alloc/src/vec')
-rw-r--r--library/alloc/src/vec/into_iter.rs2
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 e02ad391a59..4351548811d 100644
--- a/library/alloc/src/vec/into_iter.rs
+++ b/library/alloc/src/vec/into_iter.rs
@@ -148,7 +148,7 @@ impl<T, A: Allocator> Iterator for IntoIter<T, A> {
 
     #[inline]
     fn next(&mut self) -> Option<T> {
-        if self.ptr as *const _ == self.end {
+        if self.ptr == self.end {
             None
         } else if mem::size_of::<T>() == 0 {
             // purposefully don't use 'ptr.offset' because for