Skip to content

Conversation

@GrigorenkoPV
Copy link
Contributor

@GrigorenkoPV GrigorenkoPV commented Nov 9, 2025

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.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 9, 2025

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@GrigorenkoPV
Copy link
Contributor Author

Conflicts with #148769, let's wait for that first

@GrigorenkoPV GrigorenkoPV marked this pull request as draft November 9, 2025 20:53
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2025
@joboet
Copy link
Member

joboet commented Nov 9, 2025

I really prefer the current spelling of Alignment::of as opposed to alignment_of and therefore would like to suggest adding of_val and of_val_raw as associated methods instead of free-standing functions in mem.

// (However, we do not analogously require `align >= sizeof(void*)`,
// even though that is *also* a requirement of `posix_memalign`.)
align: Alignment,
alignment: Alignment,
Copy link
Member

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.

Comment on lines 83 to 76
const fn is_size_alignment_valid(size: usize, alignment: Alignment) -> bool {
if size > Self::max_size_for_alignment(alignment) {
return false;
}
true
}
Copy link
Member

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.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GrigorenkoPV
Copy link
Contributor Author

Looks like the failure is due to the rename of master branch and is unrelated to this PR

@bors
Copy link
Collaborator

bors commented Nov 20, 2025

☔ The latest upstream changes (presumably #149109) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 27, 2025

☔ The latest upstream changes (presumably #149775) made this pull request unmergeable. Please resolve the merge conflicts.

@scottmcm
Copy link
Member

Note that this is still a draft so I haven't been looking at it.

After you next rebase, please undraft it and @rustbot ready so it'll show up in my queue again.

@rust-bors

This comment has been minimized.

@scottmcm
Copy link
Member

Is this ready to go now? I see it's still a draft -- do you need to click this button?
image

@GrigorenkoPV GrigorenkoPV marked this pull request as ready for review January 18, 2026 22:44
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 18, 2026
@GrigorenkoPV
Copy link
Contributor Author

Oh yeah, I was waiting for CI to pass.

@rustbot ready

@rust-bors

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 20, 2026

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.

@scottmcm
Copy link
Member

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 24, 2026

📌 Commit bc0cce1 has been approved by scottmcm

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 24, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 25, 2026
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`.
rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
…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)
rust-bors bot pushed a commit that referenced this pull request Jan 25, 2026
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)
@rust-bors rust-bors bot merged commit 2da5959 into rust-lang:main Jan 25, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 25, 2026
rust-timer added a commit that referenced this pull request Jan 25, 2026
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`.
@GrigorenkoPV GrigorenkoPV deleted the aligment_api branch January 25, 2026 13:39
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 26, 2026
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)
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Jan 27, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants