-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
ptr_aligment_type: add more APIs #148764
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
ptr_aligment_type: add more APIs #148764
Conversation
This comment has been minimized.
This comment has been minimized.
|
Conflicts with #148769, let's wait for that first |
|
I really prefer the current spelling of |
7310020 to
a16807e
Compare
library/core/src/alloc/layout.rs
Outdated
| // (However, we do not analogously require `align >= sizeof(void*)`, | ||
| // even though that is *also* a requirement of `posix_memalign`.) | ||
| align: Alignment, | ||
| alignment: Alignment, |
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.
This rename is so big that github hides it by default.
Please make this PR just the api addition. If you also want to rename this field, that's fine, but please do it separately because of how much it touches.
| const fn is_size_alignment_valid(size: usize, alignment: Alignment) -> bool { | ||
| if size > Self::max_size_for_alignment(alignment) { | ||
| return false; | ||
| } | ||
| true | ||
| } |
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.
fix: you don't need the return, the true, or the false here.
This comment has been minimized.
This comment has been minimized.
a16807e to
47829f5
Compare
This comment has been minimized.
This comment has been minimized.
|
Looks like the failure is due to the rename of |
|
☔ The latest upstream changes (presumably #149109) made this pull request unmergeable. Please resolve the merge conflicts. |
47829f5 to
5fa28f2
Compare
This comment has been minimized.
This comment has been minimized.
5fa28f2 to
1f2d172
Compare
This comment has been minimized.
This comment has been minimized.
1f2d172 to
988791e
Compare
|
☔ The latest upstream changes (presumably #149775) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Note that this is still a draft so I haven't been looking at it. After you next rebase, please undraft it and |
988791e to
ac8a61b
Compare
This comment has been minimized.
This comment has been minimized.
ac8a61b to
bc70e35
Compare
|
Oh yeah, I was waiting for CI to pass. @rustbot ready |
This comment has been minimized.
This comment has been minimized.
bc70e35 to
bc0cce1
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ |
ptr_aligment_type: add more APIs As per rust-lang#102070 (comment) Tracking issue: rust-lang#102070 Mostly duplicating methods that previously worked with `usize`-represented alignments. Naming follows a convention of `align: usize`, `alignment: Alignment`.
…uwer Rollup of 11 pull requests Successful merges: - #145393 (Add codegen test for removing trailing zeroes from `NonZero`) - #148764 (ptr_aligment_type: add more APIs) - #149869 (std: avoid tearing `dbg!` prints) - #150065 (add CSE optimization tests for iterating over slice) - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7) - #151505 (Various refactors to the proc_macro bridge) - #151560 (relnotes: fix 1.93's `as_mut_array` methods) - #151611 (Improve is_ascii performance on x86_64 with explicit SSE2 intrinsics) - #151317 (x86 soft-float feature: mark it as forbidden rather than unstable) - #151577 (Rename `DepKindStruct` to `DepKindVTable`) - #151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
Rollup of 10 pull requests Successful merges: - #145393 (Add codegen test for removing trailing zeroes from `NonZero`) - #148764 (ptr_aligment_type: add more APIs) - #149869 (std: avoid tearing `dbg!` prints) - #150065 (add CSE optimization tests for iterating over slice) - #150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7) - #151505 (Various refactors to the proc_macro bridge) - #151560 (relnotes: fix 1.93's `as_mut_array` methods) - #151317 (x86 soft-float feature: mark it as forbidden rather than unstable) - #151577 (Rename `DepKindStruct` to `DepKindVTable`) - #151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
Rollup merge of #148764 - GrigorenkoPV:aligment_api, r=scottmcm ptr_aligment_type: add more APIs As per #102070 (comment) Tracking issue: #102070 Mostly duplicating methods that previously worked with `usize`-represented alignments. Naming follows a convention of `align: usize`, `alignment: Alignment`.
Rollup of 10 pull requests Successful merges: - rust-lang/rust#145393 (Add codegen test for removing trailing zeroes from `NonZero`) - rust-lang/rust#148764 (ptr_aligment_type: add more APIs) - rust-lang/rust#149869 (std: avoid tearing `dbg!` prints) - rust-lang/rust#150065 (add CSE optimization tests for iterating over slice) - rust-lang/rust#150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7) - rust-lang/rust#151505 (Various refactors to the proc_macro bridge) - rust-lang/rust#151560 (relnotes: fix 1.93's `as_mut_array` methods) - rust-lang/rust#151317 (x86 soft-float feature: mark it as forbidden rather than unstable) - rust-lang/rust#151577 (Rename `DepKindStruct` to `DepKindVTable`) - rust-lang/rust#151620 (Fix 'the the' typo in library/core/src/array/iter.rs)
Rollup of 10 pull requests Successful merges: - rust-lang/rust#145393 (Add codegen test for removing trailing zeroes from `NonZero`) - rust-lang/rust#148764 (ptr_aligment_type: add more APIs) - rust-lang/rust#149869 (std: avoid tearing `dbg!` prints) - rust-lang/rust#150065 (add CSE optimization tests for iterating over slice) - rust-lang/rust#150842 (Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7) - rust-lang/rust#151505 (Various refactors to the proc_macro bridge) - rust-lang/rust#151560 (relnotes: fix 1.93's `as_mut_array` methods) - rust-lang/rust#151317 (x86 soft-float feature: mark it as forbidden rather than unstable) - rust-lang/rust#151577 (Rename `DepKindStruct` to `DepKindVTable`) - rust-lang/rust#151620 (Fix 'the the' typo in library/core/src/array/iter.rs)

As per #102070 (comment)
Tracking issue: #102070
Mostly duplicating methods that previously worked with
usize-represented alignments.Naming follows a convention of
align: usize,alignment: Alignment.