-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pointer is_aligned*
methods
#100820
Use pointer is_aligned*
methods
#100820
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@@ -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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd guess this was left from times when self.ptr
and self.end
had different types?... But they currently use the same type, so this is useless:
rust/library/alloc/src/vec/into_iter.rs
Lines 41 to 42 in de9da0b
pub(super) ptr: *const T, | |
pub(super) end: *const T, |
is_ligned*
methodsis_aligned*
methods
Thanks for splitting these out! @bors r+ rollup |
…thods, 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_
…thods, 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_
…thods, 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_
@bors r- failed in rollup |
de9da0b
to
efef211
Compare
I've added the missing feature flag 🥲 |
@bors r+ |
Rollup of 8 pull requests Successful merges: - rust-lang#98200 (Expand potential inner `Or` pattern for THIR) - rust-lang#99770 (Make some const prop mir-opt tests `unit-test`s) - rust-lang#99957 (Rework Ipv6Addr::is_global to check for global reachability rather than global scope - rebase) - rust-lang#100331 (Guarantee `try_reserve` preserves the contents on error) - rust-lang#100336 (Fix two const_trait_impl issues) - rust-lang#100713 (Convert diagnostics in parser/expr to SessionDiagnostic) - rust-lang#100820 (Use pointer `is_aligned*` methods) - rust-lang#100872 (Add guarantee that Vec::default() does not alloc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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